Skip to content

v0.0.3

v0.0.3 #8

Workflow file for this run

name: Release
permissions:
contents: read
on:
release:
types: [created]
jobs:
release:
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
- name: NuGet login (OIDC → temp API key)
uses: NuGet/login@v1
id: login
with:
user: ${{ secrets.NUGET_USER }}
- name: Extract version from tag
id: get_version
run: |
VERSION=${GITHUB_REF#refs/tags/}
VERSION=${VERSION#v}
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
env:
GITHUB_REF: ${{ github.ref }}
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.x
9.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore -p:Version=${{ steps.get_version.outputs.VERSION }}
- name: Pack nuget
run: dotnet pack -c Release --no-build -p:PackageVersion=${{ steps.get_version.outputs.VERSION }}
- name: Publish the package to nuget.org
run: dotnet nuget push */bin/Release/*.nupkg -k $NUGET_AUTH_TOKEN -s https://api.nuget.org/v3/index.json
env:
NUGET_AUTH_TOKEN: ${{ steps.login.outputs.NUGET_API_KEY }}