Skip to content

Commit

Permalink
Fix package upload workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Jayden <[email protected]>
  • Loading branch information
jvyden authored Oct 18, 2023
1 parent f3baa90 commit 0eaaf07
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,29 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x

- name: Restore
run: dotnet restore

- name: Set VERSION variable from tag (for tag pushes)
if: contains(github.ref, 'refs/heads')
if: ${{ contains(github.ref, 'refs/tags') }}
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV

- name: Set VERSION variable from tag (for normal commits)
if: !contains(github.ref, 'refs/heads')
if: ${{ !contains(github.ref, 'refs/tags') }}
run: echo "VERSION=0.0.0" >> $GITHUB_ENV

- name: Build
run: dotnet build -c Release --no-restore /p:Version=${VERSION} /p:PackageVersion=${VERSION}
# - name: Test
# run: dotnet test -c Release --no-restore --no-build

- name: Pack
run: dotnet pack -c Release /p:Version=${VERSION} --no-restore

- name: Upload Package
run: dotnet nuget push AttribDoc/bin/Release/AttribDoc.${VERSION}.nupkg --source https://api.nuget.org/v3/index.json --api-key ${NUGET_TOKEN}
env:
Expand Down

0 comments on commit 0eaaf07

Please sign in to comment.