Skip to content

Commit

Permalink
Release nuget package as artifact
Browse files Browse the repository at this point in the history
  • Loading branch information
cheziyi committed Mar 17, 2020
1 parent 4070a2f commit 03735b7
Showing 1 changed file with 24 additions and 9 deletions.
33 changes: 24 additions & 9 deletions .github/workflows/release-dotnet-nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,6 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Get version
id: get_version
run: |
tag_name=${{ github.event.release.tag_name }}
echo ::set-output name=VERSION::${tag_name:1}
shell: bash
- name: Add msbuild to PATH
uses: microsoft/[email protected]
- name: Setup nuget
Expand All @@ -54,8 +48,29 @@ jobs:
- name: Restore packages
run: nuget restore
- name: Build with msbuild
run: msbuild -p:Configuration=Release -p:Version=${{ steps.get_version.outputs.VERSION }}
run: msbuild -p:Configuration=Release -p:Version=${{ github.event.release.tag_name }}
- name: Pack nuget packages
run: dotnet pack --configuration Release --no-build -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg -p:PackageVersion=${{ steps.get_version.outputs.VERSION }}
run: dotnet pack --configuration Release --no-build --output nupkgs -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg -p:PackageVersion=${{ github.event.release.tag_name }}
- name: Publish nuget packages
run: dotnet nuget push **/*.nupkg --source "github"
run: dotnet nuget push **/*.nupkg --source "github"
- name: Upload artifacts
uses: actions/upload-artifact@v1
with:
name: nupkgs
path: nupkgs

release:
needs: publish
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v1
with:
name: nupkgs
path: nupkgs
- name: Release artifacts
uses: skx/github-action-publish-binaries@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: 'nupkgs/*'

0 comments on commit 03735b7

Please sign in to comment.