rony-chat-bot/.github/workflows/release.yml
Victor Hugo Vargas 814feae6a9 build: introduce VERSION file and tag-driven release
- 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
2026-07-30 22:30:16 -07:00

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