Skip to content

SIANXSVC-1203: Ensure library_version has correct value (#8) #6

SIANXSVC-1203: Ensure library_version has correct value (#8)

SIANXSVC-1203: Ensure library_version has correct value (#8) #6

Workflow file for this run

name: Publish package
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
jobs:
nuget-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Verify commit exists in origin/main
run: |
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
git branch --remote --contains | grep origin/main
- name: Set VERSION variable from tag
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV
- uses: actions/setup-dotnet@v4
with:
dotnet-version: "8.0.x"
- run: dotnet restore
- run: dotnet pack --no-restore --include-symbols -o . /p:Version=${VERSION}
- name: Deploy to NuGet
run: dotnet nuget push *.nupkg --api-key $NUGET_AUTH_TOKEN --source https://api.nuget.org/v3/index.json
env:
NUGET_AUTH_TOKEN: ${{ secrets.NUGET_TOKEN }}
- name: Deploy to GitHub Package Registry
run: dotnet nuget push *.nupkg --api-key $NUGET_AUTH_TOKEN --source https://nuget.pkg.github.com/anexia/index.json
env:
NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}