VersionBump : v3.0.0 #10
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 Packages | |
on: | |
push: | |
tags: | |
- 'v*.*.*' # Match version tags like v1.0.0 | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
framework: [net8.0, net9.0, netstandard2.0] # Multiple target frameworks, because we design for multiple | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: '9.x' | |
- name: Restore dependencies | |
run: dotnet restore Unions.sln | |
- name: Build for framework ${{ matrix.framework }} | |
run: dotnet build Unions.sln --configuration Release --no-restore --framework ${{ matrix.framework }} | |
- name: Save build artifacts | |
run: | | |
mkdir -p ${{ github.workspace }}/artifacts | |
find . -name '*.nupkg' -exec cp {} ${{ github.workspace }}/artifacts/ \; | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: nuget-packages # Name of the artifact | |
path: ${{ github.workspace }}/artifacts # Path to collect artifacts | |
publish: | |
needs: build # Wait for the build job to finish | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: '9.x' | |
- name: Download build artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: nuget-packages # Name of the uploaded artifact to fetch | |
path: artifacts # Path to extract artifacts in this job workspace | |
- name: Publish to NuGet | |
env: | |
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} # NuGet API Key from GitHub secrets | |
run: | | |
dotnet nuget push artifacts/*.nupkg --api-key $NUGET_API_KEY --source https://api.nuget.org/v3/index.json --skip-duplicate |