Skip to content

Commit 31d3858

Browse files
authored
Replace Appveyor with GitHub Actions (#391)
1 parent 3197640 commit 31d3858

File tree

22 files changed

+212
-554
lines changed

22 files changed

+212
-554
lines changed

.github/dependabot.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: nuget
4+
directory: "/"
5+
schedule:
6+
interval: daily
7+
time: '02:00'
8+
open-pull-requests-limit: 10

.github/labeler.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
"test":
2+
- Tests/**/*
3+
4+
"CI":
5+
- .github/workflows/**/*
6+
7+
"code style":
8+
- .editorconfig
9+
10+
"performance":
11+
- src/Benchmarks/**/*

.github/workflows/build.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Build artifacts
2+
3+
# ==== NOTE: do not rename this yml file or the run_number will be reset ====
4+
5+
on:
6+
push:
7+
branches:
8+
- master
9+
- develop
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v2
16+
- name: Use .NET Core 3.1 SDK
17+
uses: actions/setup-dotnet@v1
18+
with:
19+
dotnet-version: '3.1.x'
20+
source-url: https://nuget.pkg.github.com/graphql-dotnet/index.json
21+
env:
22+
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
23+
- name: Install dependencies
24+
run: dotnet restore
25+
env:
26+
DOTNET_NOLOGO: true
27+
DOTNET_CLI_TELEMETRY_OPTOUT: true
28+
- name: Build solution [Release]
29+
run: dotnet build --no-restore -c Release -p:NoWarn=CS1591 -p:VersionSuffix=$GITHUB_RUN_NUMBER
30+
- name: Pack solution [Release]
31+
run: dotnet pack --no-restore --no-build -c Release -p:VersionSuffix=$GITHUB_RUN_NUMBER -o out
32+
- name: Upload artifacts
33+
uses: actions/upload-artifact@v2
34+
with:
35+
name: Nuget packages
36+
path: |
37+
out/*
38+
- name: Publish Nuget packages to GitHub registry
39+
run: dotnet nuget push "out/*" -k ${{secrets.GITHUB_TOKEN}}

.github/workflows/label.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# This workflow will triage pull requests and apply a label based on the
2+
# paths that are modified in the pull request.
3+
#
4+
# To use this workflow, you will need to set up a .github/labeler.yml
5+
# file with configuration. For more information, see:
6+
# https://github.com/actions/labeler/blob/master/README.md
7+
8+
name: Labeler
9+
on: [pull_request]
10+
11+
jobs:
12+
label:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/labeler@v2
16+
with:
17+
repo-token: "${{ secrets.GITHUB_TOKEN }}"

.github/workflows/publish.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Publish release
2+
3+
on:
4+
release:
5+
types:
6+
- published
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- name: Check github.ref starts with 'refs/tags/'
14+
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
15+
run: |
16+
echo Error! github.ref does not start with 'refs/tags'
17+
echo github.ref: ${{ github.ref }}
18+
exit 1
19+
- name: Set version number environment variable
20+
env:
21+
github_ref: ${{ github.ref }}
22+
run: |
23+
version="${github_ref:10}"
24+
echo version=$version
25+
echo "version=$version" >> $GITHUB_ENV
26+
- name: Use .NET Core 3.1 SDK
27+
uses: actions/setup-dotnet@v1
28+
with:
29+
dotnet-version: '3.1.x'
30+
source-url: https://api.nuget.org/v3/index.json
31+
env:
32+
NUGET_AUTH_TOKEN: ${{secrets.NUGET_AUTH_TOKEN}}
33+
- name: Install dependencies
34+
run: dotnet restore
35+
env:
36+
DOTNET_NOLOGO: true
37+
DOTNET_CLI_TELEMETRY_OPTOUT: true
38+
- name: Build solution [Release]
39+
run: dotnet build --no-restore -c Release -p:NoWarn=CS1591 -p:Version=$version
40+
- name: Pack solution [Release]
41+
run: dotnet pack --no-restore --no-build -c Release -p:Version=$version -o out
42+
- name: Upload artifacts
43+
uses: actions/upload-artifact@v2
44+
with:
45+
name: Nuget packages
46+
path: |
47+
out/*
48+
- name: Publish Nuget packages to Nuget registry
49+
run: dotnet nuget push "out/*" -k ${{secrets.NUGET_AUTH_TOKEN}}

.github/workflows/test.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Run code tests
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
- develop
8+
9+
jobs:
10+
test:
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
matrix:
14+
os:
15+
- ubuntu-latest
16+
- windows-latest
17+
steps:
18+
- name: Checkout source
19+
uses: actions/checkout@v2
20+
- name: Use .NET Core 2.2 SDK
21+
uses: actions/setup-dotnet@v1
22+
with:
23+
dotnet-version: '2.2.x'
24+
- name: Use .NET Core 3.1 LTS SDK
25+
uses: actions/setup-dotnet@v1
26+
with:
27+
dotnet-version: '3.1.x'
28+
source-url: https://nuget.pkg.github.com/graphql-dotnet/index.json
29+
env:
30+
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
31+
- name: Install dependencies
32+
run: dotnet restore
33+
env:
34+
DOTNET_NOLOGO: true
35+
DOTNET_CLI_TELEMETRY_OPTOUT: true
36+
- name: Build solution [Release]
37+
run: dotnet build --no-restore -c Release -p:NoWarn=CS1591
38+
- name: Build solution [Debug]
39+
run: dotnet build --no-restore -p:NoWarn=CS1591
40+
- name: Test solution [Debug]
41+
run: dotnet test --no-restore --no-build

.github/workflows/wipcheck.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Check if PR title contains [WIP]
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened # when PR is opened
7+
- edited # when PR is edited
8+
- synchronize # when code is added
9+
- reopened # when a closed PR is reopened
10+
11+
jobs:
12+
check-title:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Fail build if pull request title contains [WIP]
17+
if: ${{ contains(github.event.pull_request.title, '[WIP]') }} # This function is case insensitive.
18+
run: |
19+
echo Warning! PR title "${{ github.event.pull_request.title }}" contains [WIP]. Remove [WIP] from the title when PR is ready.
20+
exit 1

Directory.Build.props

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,28 @@
11
<Project>
22

33
<PropertyGroup Label="Сommon properties">
4+
<VersionPrefix>4.1.0-preview</VersionPrefix>
45
<LangVersion>latest</LangVersion>
56
<PackageProjectUrl>https://github.com/graphql-dotnet/server</PackageProjectUrl>
6-
<RepositoryUrl>https://github.com/graphql-dotnet/server</RepositoryUrl>
7-
<RepositoryType>Git</RepositoryType>
7+
<RepositoryType>git</RepositoryType>
8+
<PublishRepositoryUrl>true</PublishRepositoryUrl>
89
<Copyright>Pekka Heikura</Copyright>
910
<Authors>Pekka Heikura</Authors>
1011
<Product>graphql-dotnet server</Product>
1112
<Company>graphql-dotnet</Company>
12-
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\$(MSBuildProjectName).xml</DocumentationFile>
13+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
14+
<Deterministic>true</Deterministic>
15+
<!-- https://help.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables -->
16+
<ContinuousIntegrationBuild Condition="'$(GITHUB_ACTIONS)' == 'true'">True</ContinuousIntegrationBuild>
17+
18+
<DebugType>embedded</DebugType>
19+
<EmbedUntrackedSources>true</EmbedUntrackedSources>
1320
</PropertyGroup>
1421

22+
<ItemGroup>
23+
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" Condition="'$(IsPackable)' == 'true'"/>
24+
</ItemGroup>
25+
1526
<PropertyGroup>
1627
<IsNetCore3OnwardsTarget>$(TargetFramework.StartsWith('netcoreapp3.'))</IsNetCore3OnwardsTarget>
1728
</PropertyGroup>

GitVersion.yml

Whitespace-only changes.

appveyor.yml

Lines changed: 0 additions & 43 deletions
This file was deleted.

0 commit comments

Comments
 (0)