diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0c4dff7d..432f993f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,8 +5,8 @@ name: Nuget Publish # Controls when the action will run. on: # Triggers the workflow on push or pull request events but only for the master branch - push: - branches: [ master ] + release: + types: [ published ] # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: @@ -24,7 +24,7 @@ jobs: with: dotnet-version: 5.0.x - run: dotnet build - - run: dotnet pack -c Release + - run: dotnet pack -c Release -o packed /p:Version=${{ github.event.release.tag_name }} - name: Setup NuGet.exe for use with actions # You may pin to the exact commit or the version. # uses: NuGet/setup-nuget@04b0c2b8d1b97922f67eca497d7cf0bf17b8ffe1 @@ -32,4 +32,4 @@ jobs: with: # NuGet version to install. Can be `latest`, `preview`, a concrete version like `5.3.1`, or a semver range specifier like `5.x`. nuget-api-key: ${{ secrets.NUGET_KEY }} - - run: nuget push **/obj/Release/**/**.nupkg + - run: nuget push packed/**.nupkg