name: Release tag
on:
push:
branches:
paths:
- Cargo.toml
permissions:
contents: write
jobs:
tag:
name: Tag release version
runs-on: ubuntu-latest
# Don't re-run on patch bump amends
if: "!contains(github.event.head_commit.message, '(+patch')"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Parse version
id: ver
run: |
VERSION=$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -1)
PATCH=$(echo "$VERSION" | cut -d. -f3)
echo "tag=xtui-v${VERSION}" >> "$GITHUB_OUTPUT"
echo "patch=${PATCH}" >> "$GITHUB_OUTPUT"
- name: Create release tag
if: steps.ver.outputs.patch == '0'
run: |
git tag "${{ steps.ver.outputs.tag }}"
git push origin "${{ steps.ver.outputs.tag }}"