Skip to content

Commit 7e7393f

Browse files
committed
feat(CI): Add post-release workflow
Starts a new dev version after we sucessfully released the gem. Signed-off-by: Thomas von Deyen <thomas@vondeyen.com>
1 parent 6d90cbd commit 7e7393f

1 file changed

Lines changed: 56 additions & 0 deletions

File tree

.github/workflows/post-release.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
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

0 commit comments

Comments
 (0)