Skip to content

v0.18.18.0 test: Track 6B — Track 5A test follow-ups (#73) #38

v0.18.18.0 test: Track 6B — Track 5A test follow-ups (#73)

v0.18.18.0 test: Track 6B — Track 5A test follow-ups (#73) #38

Workflow file for this run

name: Auto-tag and release on VERSION change
on:
push:
branches: [main]
paths: [VERSION]
permissions:
contents: write
jobs:
tag:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Read version and create tag
id: tag
run: |
VERSION=$(cat VERSION | tr -d '[:space:]')
if ! echo "$VERSION" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?$'; then
echo "Invalid VERSION format: '$VERSION'"
exit 1
fi
TAG="v${VERSION}"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
if git rev-parse "$TAG" >/dev/null 2>&1; then
echo "Tag $TAG already exists — skipping tag creation."
echo "tag_created=false" >> "$GITHUB_OUTPUT"
exit 0
fi
echo "Creating tag $TAG"
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag -a "$TAG" -m "Release ${VERSION}"
git push origin "$TAG"
echo "tag_created=true" >> "$GITHUB_OUTPUT"
echo "Tagged $TAG successfully."
- name: Create GitHub release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG: ${{ steps.tag.outputs.tag }}
VERSION: ${{ steps.tag.outputs.version }}
run: |
if gh release view "$TAG" >/dev/null 2>&1; then
echo "Release $TAG already exists — skipping."
exit 0
fi
NOTES_FILE=$(mktemp)
if ./scripts/extract-changelog-section.sh "$VERSION" > "$NOTES_FILE" 2>/dev/null; then
echo "Using CHANGELOG.md section for release notes."
gh release create "$TAG" --title "$TAG" --notes-file "$NOTES_FILE"
else
echo "::warning::No CHANGELOG section for $VERSION — falling back to auto-generated notes."
gh release create "$TAG" --title "$TAG" --generate-notes
fi