Skip to content

🤘Release

🤘Release #5

Workflow file for this run

name: '🤘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: managed
path: .
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ steps.runid.outputs.run-id }}
- name: 🔢 set version environment variable
run: |
echo "VERSION=$(cat docs/version.txt | xargs)" >> "$GITHUB_ENV"
- name: 📦 Publish to NuGet
run: dotnet nuget push managed/IronCompress/bin/Release/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
- name: 📦 create release
uses: softprops/action-gh-release@v1
if: github.ref == 'refs/heads/master'
with:
tag_name: ${{ env.VERSION }}
name: ${{ env.VERSION }}
files: |
**/*.nupkg
body_path: docs/version-notes.md