Skip to content

Instantly share code, notes, and snippets.

@eeriemyxi
Created October 22, 2024 18:17
Show Gist options
  • Save eeriemyxi/3765765c994bbd2af201f844e6793097 to your computer and use it in GitHub Desktop.
Save eeriemyxi/3765765c994bbd2af201f844e6793097 to your computer and use it in GitHub Desktop.
Github Actions workfile to auto-generate release notes, releases, and upload binaries to the respective release.
on:
push:
tags:
- "v*"
name: Upload Binaries to Release
jobs:
build:
permissions: write-all
name: Upload Binaries to Release
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Deno
uses: denoland/setup-deno@v2
with:
deno-version: v2.x
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Setup Fish Shell
uses: fish-actions/[email protected]
- name: Generate Release Notes
env:
CG_CONFIG_URL: "https://gist.githubusercontent.com/eeriemyxi/da2edd0187f157f3de1f2dc74bdb6426/raw/6dc75529abb9ce54b5dc3ed2cc83afbb55691443/cliff.toml"
CG_REPO_URL: ${{github.server_url}}/${{github.repository}}
run: |
pip install git-cliff
curl -s "$CG_CONFIG_URL" | python -c "import sys,os;lines=sys.stdin.read();print(lines.replace('{{REPO}}',os.environ['CG_REPO_URL']))" > cliff.toml
git-cliff -l -o RELEASE-NOTES.md
echo "RELEASE-NOTES.md:\n"
cat RELEASE-NOTES.md
- name: Build Binaries
run: chmod +x build.fish && ./build.fish
- name: Upload Binaries to Release
uses: softprops/action-gh-release@v2
with:
body_path: RELEASE-NOTES.md
files: |
bin/*.bin
bin/*.exe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment