Feature: Upgrade .NET
from Core 3.1 to 8.0 (and Native AOT!)
#315
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build, test and publish | |
on: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- 'docs/**' | |
- '*.md' | |
pull_request: | |
paths-ignore: | |
- 'docs/**' | |
- '*.md' | |
workflow_dispatch: | |
env: | |
CONFIGURATION: "Release" | |
ARTIFACTS_STAGING_DIR_PATH: "nupkg" | |
OG_SOLUTION_PATH: "Octokit.GraphQL.sln" | |
OG_UNIT_TESTS_PROJ_PATH: ".\\src\\Octokit.GraphQL.UnitTests\\Octokit.GraphQL.UnitTests.csproj" | |
OG_CORE_UNIT_TESTS_PROJ_PATH: ".\\src\\Octokit.GraphQL.Core.UnitTests\\Octokit.GraphQL.Core.UnitTests.csproj" | |
OG_CORE_GENERATOR_UNIT_TESTS_PROJ_PATH: ".\\src\\Octokit.GraphQL.Core.Generation.UnitTests\\Octokit.GraphQL.Core.Generation.UnitTests.csproj" | |
OG_PACK_PROJ_PATH: ".\\src\\Octokit.GraphQL.Pack\\Octokit.GraphQL.Pack.csproj" | |
jobs: | |
build-test-publish: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout the repository | |
uses: actions/checkout@v4 | |
- name: Setup .NET & GitHub Packages | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 3.1.101 | |
source-url: https://nuget.pkg.github.com/octokit/index.json | |
env: | |
NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Setup NuGet | |
uses: nuget/setup-nuget@v2 | |
- name: Build the solution | |
run: dotnet build ${{ env.OG_SOLUTION_PATH }} -c ${{ env.CONFIGURATION }} | |
- name: Run Octokit.GraphQL.UnitTests | |
run: dotnet test -c ${{ env.CONFIGURATION }} --no-build ${{ env.OG_UNIT_TESTS_PROJ_PATH }} | |
- name: Run Octokit.GraphQL.Core.UnitTests | |
run: dotnet test -c ${{ env.CONFIGURATION }} --no-build ${{ env.OG_CORE_UNIT_TESTS_PROJ_PATH }} | |
- name: Run Octokit.GraphQL.Core.Generation.UnitTests | |
run: dotnet test -c ${{ env.CONFIGURATION }} --no-build ${{ env.OG_CORE_GENERATOR_UNIT_TESTS_PROJ_PATH }} | |
- name: Create the new package | |
run: dotnet pack ${{ env.OG_PACK_PROJ_PATH }} -o ${{ env.ARTIFACTS_STAGING_DIR_PATH }} | |
- name: Publish to GitHub Actions | |
uses: actions/upload-artifact@v4 | |
with: | |
name: nupkg | |
path: ${{ env.ARTIFACTS_STAGING_DIR_PATH }}/*.nupkg | |
- name: Publish to GitHub Packages | |
if: github.ref == 'refs/heads/main' | |
run: dotnet nuget push ${{ env.ARTIFACTS_STAGING_DIR_PATH }}/*.nupkg | |
- name: Publish to nuget.org | |
if: github.ref == 'refs/heads/main' | |
run: dotnet nuget push ${{ env.ARTIFACTS_STAGING_DIR_PATH }}/*.nupkg -s nuget.org -k ${{ secrets.NUGET_TOKEN }} |