Skip to content

Commit 4f4c56e

Browse files
committed
Release nuget packages as artifact
1 parent 7bec85c commit 4f4c56e

File tree

1 file changed

+24
-9
lines changed

1 file changed

+24
-9
lines changed

.github/workflows/release-dotnet-nuget.yml

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,6 @@ jobs:
3434
steps:
3535
- name: Checkout
3636
uses: actions/checkout@v2
37-
- name: Get version
38-
id: get_version
39-
run: |
40-
tag_name=${{ github.event.release.tag_name }}
41-
echo ::set-output name=VERSION::${tag_name:1}
42-
shell: bash
4337
- name: Add msbuild to PATH
4438
uses: microsoft/[email protected]
4539
- name: Setup nuget
@@ -54,8 +48,29 @@ jobs:
5448
- name: Restore packages
5549
run: nuget restore
5650
- name: Build with msbuild
57-
run: msbuild -p:Configuration=Release -p:Version=${{ steps.get_version.outputs.VERSION }}
51+
run: msbuild -p:Configuration=Release -p:Version=${{ github.event.release.tag_name }}
5852
- name: Pack nuget packages
59-
run: dotnet pack --configuration Release --no-build -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg -p:PackageVersion=${{ steps.get_version.outputs.VERSION }}
53+
run: dotnet pack --configuration Release --no-build --output nupkgs -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg -p:PackageVersion=${{ github.event.release.tag_name }}
6054
- name: Publish nuget packages
61-
run: dotnet nuget push **/*.nupkg --source "github"
55+
run: dotnet nuget push **/*.nupkg --source "github"
56+
- name: Upload artifacts
57+
uses: actions/upload-artifact@v1
58+
with:
59+
name: nupkgs
60+
path: nupkgs
61+
62+
release:
63+
needs: publish
64+
runs-on: ubuntu-latest
65+
steps:
66+
- name: Download artifacts
67+
uses: actions/download-artifact@v1
68+
with:
69+
name: nupkgs
70+
path: nupkgs
71+
- name: Release artifacts
72+
uses: skx/github-action-publish-binaries@master
73+
env:
74+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
75+
with:
76+
args: 'nupkgs/*'

0 commit comments

Comments
 (0)