Pre-Release #16
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'Pre-Release' | |
on: | |
workflow_dispatch: | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/master' | |
steps: | |
- name: Get latest run ID | |
id: runid | |
run: | | |
run_id=$(curl --request GET \ | |
--url https://api.github.com/repos/${{ github.repository }}/actions/workflows/build.yml/runs \ | |
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \ | |
| jq '.workflow_runs[] | select(.status=="completed") | .id' | head -1) | |
echo "::set-output name=run-id::$run_id" | |
- name: ⬇️ Download binary output from build.yml | |
uses: actions/download-artifact@v4 | |
with: | |
name: bin | |
path: bin | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
run-id: ${{ steps.runid.outputs.run-id }} | |
- name: 📦 Publish to NuGet | |
run: dotnet nuget push bin/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate |