Skip to content

Enhance release workflow to include version tagging and GitHub releas… #14

Enhance release workflow to include version tagging and GitHub releas…

Enhance release workflow to include version tagging and GitHub releas… #14

Workflow file for this run

name: Version Bump & Release
on:
push:
branches: [main]
concurrency:
group: release
cancel-in-progress: false
permissions:
contents: write
jobs:
bump:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
persist-credentials: true
- name: Skip if this is a version-bump commit
id: guard
env:
COMMIT_MSG: ${{ github.event.head_commit.message }}
run: |
if echo "$COMMIT_MSG" | grep -q "^chore: bump version"; then
echo "skip=true" >> "$GITHUB_OUTPUT"
else
echo "skip=false" >> "$GITHUB_OUTPUT"
fi
- name: Configure git
if: steps.guard.outputs.skip == 'false'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Bump patch version
if: steps.guard.outputs.skip == 'false'
id: bump
run: |
CURRENT=$(jq -r '.version' package.json)
IFS='.' read -ra PARTS <<< "$CURRENT"
NEW="${PARTS[0]}.${PARTS[1]}.$((${PARTS[2]} + 1))"
echo "new=$NEW" >> "$GITHUB_OUTPUT"
jq --arg v "$NEW" '.version = $v' package.json > _tmp.json && mv _tmp.json package.json
jq --arg v "$NEW" '.version = $v' manifests/academic-writer.json > _tmp.json && mv _tmp.json manifests/academic-writer.json
jq --arg v "$NEW" '.version = $v | .plugins[0].version = $v' .claude-plugin/marketplace.json > _tmp.json && mv _tmp.json .claude-plugin/marketplace.json
git add package.json manifests/academic-writer.json .claude-plugin/marketplace.json
git commit -m "chore: bump version to v${NEW}"
git tag "v${NEW}"
git push origin main
git push origin "v${NEW}"
- name: Create GitHub Release
if: steps.guard.outputs.skip == 'false'
uses: softprops/action-gh-release@v2
with:
tag_name: "v${{ steps.bump.outputs.new }}"
name: "v${{ steps.bump.outputs.new }}"
generate_release_notes: true