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
19 changes: 15 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@ on:
- "[0-9]+.[0-9]+.[0-9]+"
- "[0-9]+.[0-9]+.[0-9]+-[a-z]+.[0-9]+"

permissions:
contents: write

jobs:
publish:
if: github.repository == 'rameel/ramstack.parsing'
name: Publish packages
runs-on: ubuntu-latest
environment: publish

permissions:
contents: write
id-token: write

steps:
- name: Install .NET
Expand All @@ -24,14 +26,23 @@ jobs:
- name: Checkout
uses: actions/checkout@v7

- name: Verify tag commit is main HEAD
run: test "$GITHUB_SHA" = "$(git ls-remote origin refs/heads/main | cut -f1)"

- name: Build Solution
run: dotnet build -c Release -p:SkipInternalsVisibleTo=true

- name: Create NuGet Packages
run: dotnet pack -c Release -o ./nuget --no-build

- name: NuGet login (OIDC)
id: login
uses: NuGet/login@v1
with:
user: ${{ secrets.NUGET_USER }}

- name: Publish NuGet Packages
run: dotnet nuget push ./nuget/*.nupkg --api-key ${{secrets.NUGET_API_KEY}} --skip-duplicate -s https://api.nuget.org/v3/index.json
run: dotnet nuget push ./nuget/*.nupkg --api-key ${{ steps.login.outputs.NUGET_API_KEY }} --skip-duplicate -s https://api.nuget.org/v3/index.json

- name: Create GitHub Release
uses: softprops/action-gh-release@v3
Expand Down
Loading