8.4.0 #39
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: Publish to NuGet | |
on: | |
release: | |
types: [published] | |
jobs: | |
test: | |
name: Build and test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 6.0.x | |
- name: Extract version from tag | |
id: get_version | |
uses: battila7/get-version-action@v2 | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Build | |
run: dotnet build --no-restore --configuration Release /p:ContinuousIntegrationBuild=true /p:Version="${{ steps.get_version.outputs.version-without-v }}" | |
- name: Test | |
run: dotnet test --no-build --verbosity normal --configuration Release /p:CollectCoverage=true /p:CoverletOutputFormat=opencover | |
- name: Codecov | |
uses: codecov/codecov-action@v3 | |
- name: Pack | |
run: dotnet pack --no-build --include-symbols --verbosity normal --configuration Release --output ./artifacts /p:PackageVersion="${{ steps.get_version.outputs.version-without-v }}" | |
- name: Build self-contained apps for Windows, Linux, and macOS # Needs to run after dotnet-pack because it performs another build | |
shell: pwsh | |
run: ./self-contained.ps1 | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: "NuGet packages" | |
path: ./artifacts | |
- name: Publish artifacts to NuGet.org | |
run: dotnet nuget push './artifacts/*.nupkg' -s https://api.nuget.org/v3/index.json -k ${NUGET_API_KEY} --skip-duplicate | |
env: | |
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} | |
- name: Upload artifacts to the GitHub release | |
uses: Roang-zero1/github-upload-release-artifacts-action@v3.0.0 | |
with: | |
args: ./artifacts | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |