rony-chat-bot/.github/workflows/release.yml
Victor Hugo Vargas 9f0dd6205a
Some checks are pending
Release / release (push) Waiting to run
ci(release): honor [skip-release] marker in tag annotation
Tags annotated with [skip-release] in their message are created
without a GitHub Release. Useful for state-marker tags that should
not be announced as a release.

Example:
  git tag -a v0.1.0-alpha -m 'Release v0.1.0-alpha [skip-release]'
2026-07-30 22:45:40 -07:00

52 lines
1.4 KiB
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: Check skip-release marker
id: skip
run: |
msg=$(git for-each-ref "refs/tags/${GITHUB_REF_NAME}" --format='%(contents:subject)')
if echo "$msg" | grep -q '\[skip-release\]'; then
echo "skip=true (tag message contains [skip-release])"
echo "skip=true" >> "$GITHUB_OUTPUT"
else
echo "skip=false"
echo "skip=false" >> "$GITHUB_OUTPUT"
fi
- name: Create GitHub release
if: steps.skip.outputs.skip != 'true'
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
name: ${{ github.ref_name }}
prerelease: true
generate_release_notes: true