Skip to content

Commit 4489efe

Browse files
dsarnoclaude
andcommitted
Add bump-and-release workflow
Manual workflow_dispatch that takes major/minor/patch, updates plugin.cfg + pyproject.toml, commits, tags, and pushes. The existing release.yml picks up the tag and builds the ZIP. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 7af39b3 commit 4489efe

1 file changed

Lines changed: 56 additions & 0 deletions

File tree

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Bump and Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
bump:
7+
description: "Version bump type"
8+
required: true
9+
type: choice
10+
options:
11+
- patch
12+
- minor
13+
- major
14+
15+
permissions:
16+
contents: write
17+
18+
jobs:
19+
bump:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v4
23+
24+
- name: Read current version
25+
id: current
26+
run: |
27+
version=$(grep '^version=' plugin/addons/godot_ai/plugin.cfg | sed 's/version="//' | sed 's/"//')
28+
echo "version=$version" >> "$GITHUB_OUTPUT"
29+
30+
- name: Compute new version
31+
id: next
32+
run: |
33+
IFS='.' read -r major minor patch <<< "${{ steps.current.outputs.version }}"
34+
case "${{ inputs.bump }}" in
35+
major) major=$((major + 1)); minor=0; patch=0 ;;
36+
minor) minor=$((minor + 1)); patch=0 ;;
37+
patch) patch=$((patch + 1)) ;;
38+
esac
39+
echo "version=${major}.${minor}.${patch}" >> "$GITHUB_OUTPUT"
40+
41+
- name: Update version files
42+
run: |
43+
NEW="${{ steps.next.outputs.version }}"
44+
OLD="${{ steps.current.outputs.version }}"
45+
sed -i "s/version=\"${OLD}\"/version=\"${NEW}\"/" plugin/addons/godot_ai/plugin.cfg
46+
sed -i "s/^version = \"${OLD}\"/version = \"${NEW}\"/" pyproject.toml
47+
48+
- name: Commit, tag, and push
49+
run: |
50+
NEW="${{ steps.next.outputs.version }}"
51+
git config user.name "github-actions[bot]"
52+
git config user.email "github-actions[bot]@users.noreply.github.com"
53+
git add plugin/addons/godot_ai/plugin.cfg pyproject.toml
54+
git commit -m "Bump version to ${NEW}"
55+
git tag "v${NEW}"
56+
git push origin main --tags

0 commit comments

Comments
 (0)