Skip to content

version 1.6

version 1.6 #4

Workflow file for this run

name: Auto Tag & Release
on:
push:
branches: [main]
jobs:
tag-and-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check commit message and extract version
id: get_version
run: |
MSG="$(git log -1 --pretty=%B)"
if [[ "$MSG" =~ ^version[[:space:]]([0-9]+\.[0-9]+)$ ]]; then
VERSION="v${BASH_REMATCH[1]}"
echo "version=$VERSION" >> $GITHUB_OUTPUT
else
echo "No version bump commit, skipping."
exit 0
fi
- name: Create Tag
if: steps.get_version.outputs.version != ''
env:
GH_PAT: ${{ secrets.GH_PAT }}
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag ${{ steps.get_version.outputs.version }}
git push origin ${{ steps.get_version.outputs.version }}
- name: Create GitHub Release
if: steps.get_version.outputs.version != ''
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.get_version.outputs.version }}
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}