Auto-bump version on staging and prod deploys#150
Open
aditeyabaral wants to merge 9 commits into
Open
Conversation
- Patch version bumped in deploy-staging.yaml before calling the Render hook, ensuring staging always runs the version shown on the dev branch - Minor version bumped in deploy-prod.yaml after syncing dev to main, with patch reset to 0 and the bump synced back to dev afterward to prevent branch divergence on subsequent deploys
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds automated semantic version bumping to the deployment workflows: patch bumps on dev during staging deploys, and minor bumps on main during production deploys, with additional branch sync steps to keep dev and main aligned.
Changes:
- Add a staging workflow concurrency group and a patch-version bump + commit/push step on
devbefore staging deployment. - Add a production workflow job to bump the minor version on
main(commit/push) after syncingdev → main. - Add a production workflow job to fast-forward
devto the updatedmain, and update downstream job dependencies to follow the new bump/sync sequence.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| .github/workflows/deploy-staging.yaml | Adds concurrency control and auto patch bump + push to dev before triggering the staging deploy hook. |
| .github/workflows/deploy-prod.yaml | Adds auto minor bump on main, syncs the bump back to dev, and rewires job needs to reflect the new sequencing. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- staging: guard against feedback loop by skipping bot bump commits, checkout exact validated SHA instead of rebasing on latest dev, verify dev HEAD matches before bumping, push via HEAD:dev from detached HEAD - prod: add error handler with recovery message to sync-minor-to-dev fast-forward step, add missing permissions/contents:write to sync-dev-to-main, remove no-op git merge --abort after --ff-only failure
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces automated version bumping to the deployment workflows and improves the safety and consistency of deployments to both staging and production environments. The main changes include adding a script for version bumping, updating the GitHub Actions workflows to use this script, and enhancing deployment checks to prevent accidental or redundant deployments.
Automated version management and deployment workflow improvements:
Version bumping automation:
scripts/bump_version.pythat automatically bumps the patch or minor version inpyproject.tomlbased on the argument provided. This script is now used in both staging and production deployment workflows.Production deployment workflow (
.github/workflows/deploy-prod.yaml):mainbranch after syncing fromdev, and to sync this version bump back todevto keep branches aligned. These jobs ensure version consistency and are required by subsequent deployment steps.contents: writepermissions for jobs that modify repository contents.Staging deployment workflow (
.github/workflows/deploy-staging.yaml):chore: bump, preventing unnecessary redeployments for automated version bumps.devbranch. This ensures each staging deployment corresponds to a unique version.devhas not advanced, improving deployment safety.