Files
hate_crack/.github/workflows/version-bump.yml
T
Justin Bollinger 546c608c33 fix: pass --debug flag to PassGPT subprocesses and create GitHub Releases on version bump
PassGPT generate/train scripts now accept --debug to log HuggingFace HTTP
requests. Version-bump workflow creates a GitHub Release (not just a tag)
so check_for_updates can find /releases/latest. Bump logic now uses minor
for feat/ branches and patch for everything else.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 15:26:53 -05:00

69 lines
2.2 KiB
YAML

name: version-bump
on:
pull_request:
types: [closed]
branches: [main]
permissions:
contents: write
jobs:
bump:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Determine version bump type
id: bump-type
run: |
BRANCH="${{ github.head_ref }}"
TITLE="${{ github.event.pull_request.title }}"
# Feature branches (feat/) bump minor, everything else bumps patch
if echo "$BRANCH" | grep -qiE '^feat/'; then
echo "type=minor" >> "$GITHUB_OUTPUT"
elif echo "$TITLE" | grep -qiE '^feat'; then
echo "type=minor" >> "$GITHUB_OUTPUT"
else
echo "type=patch" >> "$GITHUB_OUTPUT"
fi
echo "Bump type: $(grep type "$GITHUB_OUTPUT" | cut -d= -f2) (branch: $BRANCH)"
- name: Bump version
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
BUMP_TYPE="${{ steps.bump-type.outputs.type }}"
latest=$(git tag --sort=-v:refname | grep -E '^v[0-9]+\.[0-9]+' | head -1)
if [ -z "$latest" ]; then
echo "No version tag found, starting at v0.0.1"
next="v0.0.1"
else
version="${latest#v}"
major=$(echo "$version" | cut -d. -f1)
minor=$(echo "$version" | cut -d. -f2)
patch=$(echo "$version" | cut -d. -f3)
patch=${patch:-0}
if [ "$BUMP_TYPE" = "minor" ]; then
next="v${major}.$((minor + 1)).0"
else
next="v${major}.${minor}.$((patch + 1))"
fi
fi
echo "Tagging $next (previous: ${latest:-none}, bump: $BUMP_TYPE)"
git tag -a "$next" -m "Release $next"
git push origin "$next"
- name: Create GitHub Release
env:
GH_TOKEN: ${{ github.token }}
run: |
latest=$(git tag --sort=-v:refname | grep -E '^v[0-9]+\.[0-9]+' | head -1)
gh release create "$latest" --title "$latest" --notes "Release $latest" --latest