Skip to content

Commit 6b3c39a

Browse files
author
Harry
committed
dotnet/nbgv action
1 parent 6d8bc5f commit 6b3c39a

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

.github/workflows/release.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@ jobs:
1414
uses: actions/setup-dotnet@v1
1515
with:
1616
dotnet-version: '6.0.x'
17-
- name: Install nbgv
18-
run: dotnet tool install nbgv --tool-path ./tools
19-
- name: Run nbgv
20-
run: echo "NUGET_PACKAGE_VERSION=$(./tools/nbgv get-version -v NuGetPackageVersion)" >> $GITHUB_ENV
17+
- name: Nerdbank.GitVersioning
18+
uses: dotnet/[email protected]
19+
id: nbgv
2120
- name: Install dependencies
2221
run: dotnet restore
2322
- name: Pack
@@ -31,10 +30,10 @@ jobs:
3130
uses: marvinpinto/[email protected]
3231
with:
3332
repo_token: "${{ secrets.GITHUB_TOKEN }}"
34-
prerelease: ${{ contains(env.NUGET_PACKAGE_VERSION, '-preview') }}
35-
title: Release ${{ env.NUGET_PACKAGE_VERSION }}
36-
automatic_release_tag: ${{ env.NUGET_PACKAGE_VERSION }}
33+
prerelease: ${{ steps.nbgv.outputs.PrereleaseVersion != '' }}
34+
title: Release ${{ steps.nbgv.outputs.NuGetPackageVersion }}
35+
automatic_release_tag: ${{ steps.nbgv.outputs.NuGetPackageVersion }}
3736
files: |
3837
./out/*
3938
- name: Push to Nuget.org
40-
run: dotnet nuget push ${{ format('./out/Neo.BlockchainToolkit.Library.{0}.nupkg', env.NUGET_PACKAGE_VERSION) }} --api-key ${{ secrets.NUGET_ORG_TOKEN }} --source https://api.nuget.org/v3/index.json
39+
run: dotnet nuget push ${{ format('./out/Neo.BlockchainToolkit.Library.{0}.nupkg', steps.nbgv.outputs.NuGetPackageVersion) }} --api-key ${{ secrets.NUGET_ORG_TOKEN }} --source https://api.nuget.org/v3/index.json

0 commit comments

Comments
 (0)