|
1 | 1 | name: Build, test and publish
|
2 |
| - |
3 |
| -on: |
| 2 | +"on": |
4 | 3 | push:
|
5 |
| - branches: [ master ] |
| 4 | + branches: |
| 5 | + - master |
6 | 6 | pull_request:
|
7 |
| - branches: [ master ] |
8 |
| - |
| 7 | + branches: |
| 8 | + - master |
9 | 9 | env:
|
10 | 10 | config: Release
|
11 | 11 | PackageOutputPath: nupkg
|
12 |
| - |
13 | 12 | jobs:
|
14 | 13 | build-test-publish:
|
15 | 14 | runs-on: windows-latest
|
16 | 15 | steps:
|
17 |
| - - uses: actions/checkout@v2 |
18 |
| - - name: Setup .NET Core and GitHub Packages |
19 |
| - uses: actions/setup-dotnet@v1 |
20 |
| - with: |
21 |
| - dotnet-version: 3.1.101 |
22 |
| - source-url: https://nuget.pkg.github.com/octokit/index.json |
23 |
| - env: |
24 |
| - NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} |
25 |
| - - name: Setup NuGet |
26 |
| - uses: nuget/setup-nuget@v1 |
27 |
| - with: |
28 |
| - nuget-version: '5.x' |
29 |
| - |
30 |
| - - name: Build using .NET Core |
31 |
| - run: dotnet build Octokit.GraphQL.sln -c ${{ env.config }} |
32 |
| - |
33 |
| - - name: Run Octokit.GraphQL.UnitTests |
34 |
| - run: dotnet test -c ${{ env.config }} --no-build .\Octokit.GraphQL.UnitTests\Octokit.GraphQL.UnitTests.csproj # /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Exclude="[Octokit.GraphQL]Octokit.GraphQL.*" |
35 |
| - - name: Run Octokit.GraphQL.Core.UnitTests |
36 |
| - run: dotnet test -c ${{ env.config }} --no-build .\Octokit.GraphQL.Core.UnitTests\Octokit.GraphQL.Core.UnitTests.csproj # /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Exclude="[Octokit.GraphQL]Octokit.GraphQL.*" |
37 |
| - - name: Run Octokit.GraphQL.Core.Generation.UnitTests |
38 |
| - run: dotnet test -c ${{ env.config }} --no-build .\Octokit.GraphQL.Core.Generation.UnitTests\Octokit.GraphQL.Core.Generation.UnitTests.csproj # /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Exclude="[Octokit.GraphQL]Octokit.GraphQL.*" |
39 |
| - |
40 |
| - - name: Create package using .nuspec |
41 |
| - run: dotnet pack Octokit.GraphQL.Pack/Octokit.GraphQL.Pack.csproj --output ${{ env.PackageOutputPath }} |
42 |
| - |
43 |
| - - name: Upload nupkg artifact |
44 |
| - uses: actions/upload-artifact@v2 |
45 |
| - with: |
46 |
| - name: nupkg |
47 |
| - path: ${{ env.PackageOutputPath }}/*.nupkg |
48 |
| - |
49 |
| - - name: Publish to GitHub Packages |
50 |
| - if: github.ref == 'refs/heads/master' |
51 |
| - shell: bash |
52 |
| - run: dotnet nuget push ${{ env.PackageOutputPath }}/*.nupkg |
53 |
| - |
54 |
| - - name: Publish to nuget.org |
55 |
| - if: github.ref == 'refs/heads/master' |
56 |
| - shell: bash |
57 |
| - run: dotnet nuget push ${{ env.PackageOutputPath }}/*.nupkg --source nuget.org -k ${{ secrets.NUGET_TOKEN }} |
| 16 | + - uses: actions/checkout@v3 |
| 17 | + - name: Setup .NET Core and GitHub Packages |
| 18 | + uses: actions/setup-dotnet@v1 |
| 19 | + with: |
| 20 | + dotnet-version: 3.1.101 |
| 21 | + source-url: https://nuget.pkg.github.com/octokit/index.json |
| 22 | + env: |
| 23 | + NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} |
| 24 | + - name: Setup NuGet |
| 25 | + uses: nuget/setup-nuget@v1 |
| 26 | + with: |
| 27 | + nuget-version: 5.x |
| 28 | + - name: Build using .NET Core |
| 29 | + run: dotnet build Octokit.GraphQL.sln -c ${{ env.config }} |
| 30 | + - name: Run Octokit.GraphQL.UnitTests |
| 31 | + run: >- |
| 32 | + dotnet test -c ${{ env.config }} --no-build |
| 33 | + .\Octokit.GraphQL.UnitTests\Octokit.GraphQL.UnitTests.csproj |
| 34 | + - name: Run Octokit.GraphQL.Core.UnitTests |
| 35 | + run: >- |
| 36 | + dotnet test -c ${{ env.config }} --no-build |
| 37 | + .\Octokit.GraphQL.Core.UnitTests\Octokit.GraphQL.Core.UnitTests.csproj |
| 38 | + - name: Run Octokit.GraphQL.Core.Generation.UnitTests |
| 39 | + run: >- |
| 40 | + dotnet test -c ${{ env.config }} --no-build |
| 41 | + .\Octokit.GraphQL.Core.Generation.UnitTests\Octokit.GraphQL.Core.Generation.UnitTests.csproj |
| 42 | + - name: Create package using .nuspec |
| 43 | + run: >- |
| 44 | + dotnet pack Octokit.GraphQL.Pack/Octokit.GraphQL.Pack.csproj --output |
| 45 | + ${{ env.PackageOutputPath }} |
| 46 | + - name: Upload nupkg artifact |
| 47 | + uses: actions/upload-artifact@v2 |
| 48 | + with: |
| 49 | + name: nupkg |
| 50 | + path: ${{ env.PackageOutputPath }}/*.nupkg |
| 51 | + - name: Publish to GitHub Packages |
| 52 | + if: github.ref == 'refs/heads/master' |
| 53 | + shell: bash |
| 54 | + run: dotnet nuget push ${{ env.PackageOutputPath }}/*.nupkg |
| 55 | + - name: Publish to nuget.org |
| 56 | + if: github.ref == 'refs/heads/master' |
| 57 | + shell: bash |
| 58 | + run: >- |
| 59 | + dotnet nuget push ${{ env.PackageOutputPath }}/*.nupkg --source |
| 60 | + nuget.org -k ${{ secrets.NUGET_TOKEN }} |
0 commit comments