-
Notifications
You must be signed in to change notification settings - Fork 78
Automate Versioning and Releases
- Remove branch protection from
master - Delete
masterbranch - Rename
developbranch tomaster - Setup branch protections for
masterandgh-pagesand makemasterdefault branch
- Require pull request reviews before merging
- Require status checks to pass - Travis CI & CLA
- Restrict who can push to matching branches (add team here)
In https://travis-ci.org/SAP/your-repo/settings, add:
- GH_TOKEN (from fundamental-bot - https://github.com/settings/tokens)
- AUTH_TOKEN (from npmjs.com)
- NPM_EMAIL
- NPM_PASSWORD
- NPM_USERNAME
NOTE: Remember to escape special characters.
- Log into
fundamental-botand sign CLA for the repo you will be pushing to. - Add
fundamental-botto your team.
IMPORTANT: Add
fundamental-botas an admin.
NOTE: Change the first job/stage to whatever the repo specifically needs in way of linting and testing.
- Add to
"scripts":"release": "./scripts/publish-release.sh", "release:create": "create-release", "std-version": "standard-version -m \"chore(release): version %s build ${TRAVIS_BUILD_NUMBER} [ci skip]\"",
npm i -D standard-version github-assistant
The current release (master branch) is where most changes will occur. This will include features, fixes, chores and breaking changes. All merges to master will generate a release candidate (rc) version. These "rc" versions will accumulate until a release is published. See Publishing Releases. Breaking changes need to be handled in a specific way when merging the pull request. See Generate a Breaking Change Release.
- Create a branch from
masterlocally - Make necessary code changes
- Commit changes and push branch to GitHub
- Create a pull request
- Merge pull request and add
BREAKING CHANGE: Version <major-version-number>in the description of the merge message.
NOTE: The key to the breaking change is
BREAKING CHANGE:(colon included) in the description (not title) of the merge message. The title will still contain the appropriatefix:orfeat:prefix.
- Checkout either the
masterorarchive-v#branch locally that you wish to release from. - Run the following command to start the release process:
npm run release
This will kick off Travis to run standard-version, updating the version to a non-"rc" version, push the changes and the new tag and publish the package to npm and github pages when it's complete.
NOTE: Publishing releases can only be done from
masterandarchive-v#branches that currently have an "rc" version.
NOTE: Only create archive branches once a new breaking change release has been created on
master.
- On GitHub, look up the latest release from the previous major version and make a note of the tag associated with it.
- Checkout the tag locally
git checkout <tag-name> - Create the archive branch
git checkout -b archive-v<previous-major-version> # Example: archive-v3 - Make a small change to
README.md(add blank line, remove extra blank line, etc.) - Commit change and make sure to include
[ci skip]in commit message - Push branch
git push --set-upstream origin <archive-branch>
- Go to the repository on GitHub
- Select Settings tab
- Select Branches
- Under Branch protection rules, select the new branch that was pushed (
archive-v#) - Select the appropriate options (use
masterbranch as a template) and save the changes