Skip to content

ci: bump actions + dynamic go version + auto-release + badge fix (#14) #4

ci: bump actions + dynamic go version + auto-release + badge fix (#14)

ci: bump actions + dynamic go version + auto-release + badge fix (#14) #4

Workflow file for this run

name: release
# Auto-cuts a beta prerelease on every main push.
# Tag pushes are ignored so the workflow doesn't recurse.
on:
push:
branches: [main]
permissions:
contents: write
concurrency:
group: release-main
cancel-in-progress: false
jobs:
release:
name: auto-tag + release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Compute next beta tag
id: ver
run: |
latest=$(git tag -l 'v0.0.0-beta.*' \
| grep -E 'v0\.0\.0-beta\.[0-9]+$' \
| sort -V \
| tail -1)
if [ -z "$latest" ]; then
next="v0.0.0-beta.1"
else
n=${latest##*.}
next="v0.0.0-beta.$((n+1))"
fi
echo "tag=$next" >> "$GITHUB_OUTPUT"
echo "Next tag: $next"
- name: Create tag + release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -eu
tag="${{ steps.ver.outputs.tag }}"
git tag "$tag"
git push origin "$tag"
gh release create "$tag" \
--target "${{ github.sha }}" \
--prerelease \
--generate-notes \
--title "$tag"