- VERSION file at repo root is the source of truth - main.version is now a var, overridable via -ldflags - release workflow triggers on tag push and validates tag == VERSION - manual bump flow: bump VERSION, commit, tag, push
39 lines
944 B
YAML
39 lines
944 B
YAML
name: Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*.*.*'
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 5
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Verify tag matches VERSION
|
|
run: |
|
|
set -euo pipefail
|
|
tag="${GITHUB_REF_NAME#v}"
|
|
file_version=$(tr -d '[:space:]' < VERSION)
|
|
if [ "$tag" != "$file_version" ]; then
|
|
echo "::error::Tag v$tag does not match VERSION file ($file_version)"
|
|
echo "Bump VERSION first, then tag and push."
|
|
exit 1
|
|
fi
|
|
echo "VERSION=$file_version OK"
|
|
|
|
- name: Create GitHub release
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
tag_name: ${{ github.ref_name }}
|
|
name: ${{ github.ref_name }}
|
|
prerelease: true
|
|
generate_release_notes: true
|