File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Post Release
2+
3+ on :
4+ workflow_run :
5+ workflows : ["Publish Release"]
6+ types :
7+ - completed
8+
9+ jobs :
10+ bump-dev-version :
11+ if : github.event.workflow_run.conclusion == 'success'
12+ runs-on : ubuntu-latest
13+
14+ steps :
15+ - name : Generate token
16+ id : generate-token
17+ uses : actions/create-github-app-token@v1
18+ with :
19+ app-id : ${{ vars.ALCHEMY_BOT_APP_ID }}
20+ private-key : ${{ secrets.ALCHEMY_BOT_APP_PRIVATE_KEY }}
21+
22+ - uses : actions/checkout@v4
23+ with :
24+ token : ${{ steps.generate-token.outputs.token }}
25+ ref : main
26+
27+ - name : Calculate next dev version
28+ id : version
29+ run : |
30+ # Read current version
31+ CURRENT=$(grep VERSION lib/alchemy/solidus/version.rb | sed 's/.*"\(.*\)".*/\1/')
32+ echo "Current version: $CURRENT"
33+
34+ # Split into major.minor.patch
35+ IFS='.' read -r MAJOR MINOR PATCH <<< "$CURRENT"
36+
37+ # Bump minor version and add .dev suffix
38+ MINOR=$((MINOR + 1))
39+ NEW_VERSION="$MAJOR.$MINOR.0.dev"
40+ echo "New dev version: $NEW_VERSION"
41+ echo "version=$NEW_VERSION" >> $GITHUB_OUTPUT
42+
43+ - name : Configure git
44+ run : |
45+ git config user.name "alchemycms-bot"
46+ git config user.email "alchemycms-bot@users.noreply.github.com"
47+
48+ - name : Bump to dev version
49+ run : |
50+ sed -i 's/VERSION = "[^"]*"/VERSION = "${{ steps.version.outputs.version }}"/' lib/alchemy/solidus/version.rb
51+
52+ - name : Commit and push
53+ run : |
54+ git add lib/alchemy/solidus/version.rb
55+ git commit -m "Start development of version ${{ steps.version.outputs.version }}"
56+ git push origin main
You can’t perform that action at this time.
0 commit comments