PHPC-2708: Automatically create new minor version branch on release#2027
PHPC-2708: Automatically create new minor version branch on release#2027paulinevos wants to merge 1 commit into
Conversation
To automate the release process further with the appropriate verification steps necessary.
There was a problem hiding this comment.
Pull request overview
Automates parts of the PHP driver release workflow by validating the release context (tags/branches), creating a new stable minor branch when releasing a new minor from the dev branch, and ensuring subsequent merge-up/release steps target the correct release branch.
Changes:
- Adds release preflight checks (tag existence and branch/version alignment) and stores derived version/branch names in environment variables.
- Automatically creates a new stable minor branch (e.g.,
vX.Y) when releasingX.Y.0*from the dev branch (vX.x), and bumps the dev branch to the next minor development version. - Ensures merge-up determination and GitHub release draft target the computed
RELEASE_BRANCHinstead of always using the triggering branch.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| echo '🆕 Creating new release branch ${{ env.STABLE_BRANCH }} from ${{ github.ref_name }}' >> $GITHUB_STEP_SUMMARY | ||
| git checkout -b ${STABLE_BRANCH} | ||
| git push origin ${STABLE_BRANCH} | ||
| echo RELEASE_BRANCH=${STABLE_BRANCH} >> $GITHUB_ENV |
There was a problem hiding this comment.
Idk about reusing an existing branch... seems like it would be easy to use a branch that doesn't reflect the state we actually want. I'd rather use git switch --force-create and force push it I think...
What do you think @GromNaN?
There was a problem hiding this comment.
If the new branch already exists, I'd rather not overwriting it.
I don't see any reason to have the branch pre-existing (simply because we are not allowed to create it). This case should not happen, but if it happens then we should not perform a destructive action.
There was a problem hiding this comment.
Ok, so implement the suggestion or let it fail?
| echo RELEASE_BRANCH=${STABLE_BRANCH} >> $GITHUB_ENV | ||
|
|
||
| - name: "Bump default branch to next minor development version" | ||
| if: ${{ endsWith(env.RELEASE_VERSION_WITHOUT_STABILITY, '.0') && env.DEV_BRANCH == github.ref_name }} |
| git add phongo_version.h | ||
| git commit -m "Bump to next minor dev version" | ||
| git push origin ${DEV_BRANCH} |
To automate the release process further with the appropriate verification steps necessary.