Skip to content

chore: update github actions #2

chore: update github actions

chore: update github actions #2

name: Publish NuGet Package to GitHub Packages
on:
push:
branches: ['release']
release:
types: ['published']
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
attestations: write
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
- name: Restore NuGet packages
run: dotnet restore
- name: Build and pack NuGet package
run: dotnet pack --configuration Release
- name: Publish NuGet package to GitHub Packages
env:
PACKAGES_AUTH_TOKEN: ${{ secrets.PACKAGES_AUTH_TOKEN }}
OWNER: jacopouggeri
run: |
dotnet nuget add source --username $OWNER --password $PACKAGES_AUTH_TOKEN --store-password-in-clear-text --name github "https://nuget.pkg.github.com/${OWNER}/index.json"
dotnet nuget push bin/Release/*.nupkg --api-key $PACKAGES_AUTH_TOKEN --source "github" --skip-duplicate