Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
name: CI

permissions:
contents: read
packages: write

on:
push:
branches: [ main, master ]
tags: ['v*']
pull_request:
branches: [ main, master ]

Expand Down Expand Up @@ -53,7 +58,7 @@ jobs:
publish-nuget:
runs-on: ubuntu-latest
needs: pack-smoke
if: (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main') && github.event_name == 'push'
if: startsWith(github.ref, 'refs/tags/') && github.event_name == 'push'
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -102,3 +107,13 @@ jobs:
exit 1
fi
dotnet nuget push out/*.nupkg --api-key ${NUGET_API_KEY} --source https://api.nuget.org/v3/index.json --skip-duplicate

- name: Publish to GitHub Packages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if [ -z "${GITHUB_TOKEN}" ]; then
echo "Missing GITHUB_TOKEN; skipping GitHub Packages publish"
exit 1
fi
dotnet nuget push out/*.nupkg --api-key ${GITHUB_TOKEN} --source https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json --skip-duplicate