Drop netcore 3.1 and test .NET6 and .NET7 #122
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: .NET Core | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
jobs: | |
ci: | |
runs-on: windows-latest | |
strategy: | |
matrix: | |
dotnet-version: ['6.0', '7.0'] | |
env: | |
NUGET_SOURCE_URL: https://nuget.pkg.github.com/LtiLibrary/index.json | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Fetch tags | |
run: | | |
git fetch origin +refs/tags/*:refs/tags/* | |
git fetch --prune --unshallow | |
- name: Build Reason | |
run: "echo ref: ${{github.ref}} event: ${{github.event_name}}" | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: ${{ matrix.dotnet-version }} | |
source-url: ${{ env.NUGET_SOURCE_URL }} | |
env: | |
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
- name: Build | |
run: dotnet build --configuration Release --framework net${{ matrix.dotnet-version }} | |
- name: Test | |
run: dotnet test --configuration Release --results-directory artifacts --no-build --framework net${{ matrix.dotnet-version }} | |
- name: Package | |
if: github.event_name != 'pull_request' | |
run: dotnet pack --configuration Release --no-build | |
- name: Publish nuget | |
if: github.event_name != 'pull_request' | |
run: dotnet nuget push src/*/bin/Release/*.nupkg --skip-duplicate | |
- name: Publish Release Packages | |
if: startsWith(github.ref, 'refs/tags/v') | |
run: dotnet nuget push src/*/bin/Release/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_TOKEN }} | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v2.3.1 | |
with: | |
name: artifacts | |
path: artifacts |