-
Notifications
You must be signed in to change notification settings - Fork 341
84 lines (71 loc) · 2.91 KB
/
release-plugin.yml
File metadata and controls
84 lines (71 loc) · 2.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: Release Plugin
on:
push:
paths:
- '.claude-plugin/**'
branches:
- master
workflow_dispatch:
inputs:
bump_type:
description: 'Version bump type'
required: true
default: 'patch'
type: choice
options:
- patch
- minor
- major
jobs:
release-plugin:
runs-on: ubuntu-latest
# Only run on master branch, skip automated version bump commits
if: |
(github.ref == 'refs/heads/master' || github.event_name == 'workflow_dispatch') &&
(github.event_name == 'workflow_dispatch' || !contains(github.event.head_commit.message || '', 'chore(plugin): bump version'))
steps:
# Generate GitHub App token for authenticated commits (same as release.yml)
- name: Generate GitHub App Token
id: generate-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.RELEASE_APP_ID }}
private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ steps.generate-token.outputs.token }}
- name: Bump plugin version
id: bump
run: |
BUMP_TYPE="${{ github.event.inputs.bump_type || 'patch' }}"
CURRENT=$(jq -r '.version' .claude-plugin/plugin.json)
IFS='.' read -r major minor patch <<< "$CURRENT"
case $BUMP_TYPE in
major) NEW_VERSION="$((major+1)).0.0" ;;
minor) NEW_VERSION="$major.$((minor+1)).0" ;;
patch) NEW_VERSION="$major.$minor.$((patch+1))" ;;
esac
jq --arg v "$NEW_VERSION" '.version = $v' .claude-plugin/plugin.json > tmp.json
mv tmp.json .claude-plugin/plugin.json
echo "version=$NEW_VERSION" >> $GITHUB_OUTPUT
echo "Bumped plugin version from $CURRENT to $NEW_VERSION"
# Commit and push changes (identical pattern to release.yml)
- name: Commit and push changes
run: |
# Use GitHub's bot email format so the app avatar shows on commits
# The user ID (257041894) is from: gh api '/users/jengine-release-bot[bot]' --jq '.id'
# This is different from the App ID - it's the bot account's user ID
git config user.name "jengine-release-bot[bot]"
git config user.email "257041894+jengine-release-bot[bot]@users.noreply.github.com"
git add .claude-plugin/plugin.json
git commit -m "chore(plugin): bump version to ${{ steps.bump.outputs.version }}"
git push origin ${{ github.ref_name }}
echo "✅ Committed and pushed changes"
# Create Git tag
- name: Create Git tag
run: |
git tag "plugin-v${{ steps.bump.outputs.version }}"
git push origin "plugin-v${{ steps.bump.outputs.version }}"
echo "✅ Created and pushed tag plugin-v${{ steps.bump.outputs.version }}"