Skip to content

Commit

Permalink
Move NuGet publish workflow to shared-workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
markwhitaker committed Sep 18, 2022
1 parent 332baf6 commit fb92475
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions .github/workflows/build-test-and-publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,7 @@ on:
release:
types: [published]

env:
VERSION: ${{github.ref_name}}

jobs:
publish-to-nuget:
name: Build, test and publish to NuGet.org
runs-on: ubuntu-22.04
steps:
- run: echo "ASSEMBLY_VERSION=$(echo $VERSION | sed -e 's/-.*//')" >> $GITHUB_ENV
- uses: actions/checkout@v2
- run: dotnet build -c Release /p:Version=$VERSION /p:AssemblyVersion=$ASSEMBLY_VERSION
- run: dotnet test -c Release
- run: dotnet pack -c Release -o nugetPackage -p:PackageVersion=$VERSION
- run: dotnet nuget push nugetPackage/*.nupkg -k ${{secrets.NUGET_API_KEY}} -s https://api.nuget.org/v3/index.json
name: Publish release to NuGet
uses: markwhitaker/shared-workflows/.github/workflows/dotnet-publish-release-to-nuget.yml@main

0 comments on commit fb92475

Please sign in to comment.