Skip to content

Commit 23ec39c

Browse files
authored
Bump version using release branch instead of directly on main (#674)
1 parent cb9266d commit 23ec39c

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ jobs:
6969
runs-on: ubuntu-latest
7070
permissions:
7171
contents: write
72+
pull-requests: write
7273
env:
7374
VERSION: ${{ needs.validate.outputs.version }}
7475
steps:
@@ -102,17 +103,30 @@ jobs:
102103
103104
- name: Commit & tag
104105
run: |
106+
BRANCH="release/$VERSION"
107+
git checkout -b "$BRANCH"
105108
git add -A
106109
if ! git diff --cached --quiet; then
107110
git commit -m "chore: bump version to $VERSION"
108-
git push origin HEAD
109111
fi
110112
if git rev-parse "$VERSION" >/dev/null 2>&1; then
111113
echo "Tag $VERSION already exists, skipping"
112114
else
113115
git tag "$VERSION"
114116
git push origin "$VERSION"
115117
fi
118+
git push origin "$BRANCH"
119+
120+
- name: Create PR to merge version bump back to main
121+
if: ${{ !inputs.dry_run }}
122+
env:
123+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
124+
run: |
125+
gh pr create \
126+
--base main \
127+
--head "release/$VERSION" \
128+
--title "chore: bump version to $VERSION" \
129+
--body "Automated version bump from release workflow. Merge after release is complete."
116130
117131
# ---------------------------------------------------------------------------
118132
# 3. Build cross-platform binaries

0 commit comments

Comments
 (0)