Skip to content

Commit d81983a

Browse files
Initial brainstorming on new release automation
1 parent c365e32 commit d81983a

File tree

2 files changed

+104
-0
lines changed

2 files changed

+104
-0
lines changed
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Steps to Cut a New Terminus Release
2+
3+
Terminus uses [Semantic Versioning](https://semver.org/) in the format of `major.minor.patch`.
4+
5+
If any of these steps should fail, abort the release-cutting process.
6+
7+
1. For major or minor version releases, the CMS Eco product owner will decide when the new version can be released. Patch releases can be shipped as soon as Engineering is satisfied.
8+
9+
2. Move into the Terminus project's root directory and check out your target branch (e.g. `3.x`). Update that branch by using `git pull` to ensure it is up to date.
10+
11+
3. Check out a new branch for the updated version you wish to release, giving it a descriptive name like `update_to_1.0.4`. Don't use the version tag as the branch name; tags and branches can't have the same name.
12+
13+
4. Update the version number in these two locations in the codebase:
14+
1. TERMINUS_VERSION in `config/constants.yml`
15+
2. Update `## Master` in `CHANGELOG.md` to be `## [<version_number>] - <today's_date_in_big_endian>`
16+
17+
5. Commit and push your update branch and open a pull request to merge into the target branch tested in **Step 2** above (e.g. `3.x`).
18+
1. Get approval from someone authorized to approve Terminus PRs and merge this into your target branch.
19+
20+
6. Test your work to ensure that Composer won't have trouble installing the application.
21+
1. Create a new directory anywhere but in Terminus and change into it before running the test.
22+
2. Run this command. Answer `n` (No) if prompted to use another composer.json file in a directory above yours.
23+
```
24+
composer require pantheon-systems/terminus:3.x-dev
25+
```
26+
3. If there are no errors, you can delete the directory and proceed.
27+
28+
7. Create a CCB Ticket and get approval from the change committee. [https://getpantheon.atlassian.net/secure/CreateIssue.jspa?issuetype=ccb-change-request&pid=14450](https://getpantheon.atlassian.net/secure/CreateIssue.jspa?issuetype=ccb-change-request&pid=14450)
29+
30+
8. Once approved, Create a tag:
31+
1. On your local machine, checkout the target branch (e.g. `3.x`) and pull down the latest changes.
32+
2. Create a tag for the new release: `git tag 3.x.x`
33+
3. Push the tag to Github: `git push origin 3.x.x.`
34+
4. Browse to https://github.com/pantheon-systems/terminus/actions where you can see a GitHub Actions workflow has kicked off.
35+
5. This will create a release automatically with the PHAR attached from the start (which prevents a broken `self:update` gap period).
36+
37+
9. Once the release is published, edit the notes to include the changes from this release. It's convenient to copy the markdown from [https://github.com/pantheon-systems/terminus/edit/3.x/CHANGELOG.md](https://github.com/pantheon-systems/terminus/edit/3.x/CHANGELOG.md). Omit the release number and date when copying.
38+
39+
10. For releases `3.x` or later, a PR will be created in the [Homebrew formula](https://github.com/pantheon-systems/homebrew-external) repository. Take a look to it and merge it to release to Homebrew.
40+
41+
11. Update your major branch's version number to `a.b.c+1-dev`, where `a.b.c` is the latest release's version:
42+
1. In `config/constants.yml`, change the value
43+
2. In `CHANGELOG.md`, add a new heading above your most recent release. It should also be in the format of `a.b.c+1-dev`.
44+
45+
12. Open a PR against https://github.com/pantheon-systems/documentation to update [https://github.com/pantheon-systems/documentation/edit/main/source/content/terminus/10-supported-terminus.md](https://github.com/pantheon-systems/documentation/edit/main/source/content/terminus/10-supported-terminus.md).
46+
1. Add the new **Version** at the top of the list. Fill in the **Release Date** with today's date. Leave the **EOL Date** blank.
47+
2. For the most recent release on your major branch, fill in the **EOL Date**. This will be today's date plus one year.
48+
3. If applicable, remove all but one old versions per major branch that are more than one year past EOL from the list. If some of the versions for a major branch have been removed from the list, the last line in the list should read `X.Y.Z or earlier`.
49+
4. If applicable, update the Terminus [PHP Version Compatibility Matrix](https://docs.pantheon.io/terminus/supported-terminus#php-version-compatibility-matrix).
50+
5. Create a new file in `source/releasenotes` for this release. You can use [this example](https://github.com/pantheon-systems/documentation/blob/main/source/releasenotes/2024-12-05-terminus-361.md?plain=1) as a starting point.
51+
6. Set the PR title to `Terminus Release X.Y.Z` and do the following in the PR template:
52+
1. Use this for your **Summary** section:
53+
`**[Version Updates](https://docs.pantheon.io/terminus/supported-terminus)** - Terminus Release X.Y.Z`
54+
2. In the **Effect** section, add a link to your Terminus Release PR as the only bullet under **The following changes are already committed.**
55+
3. Remove the **Remaining Work and Prerequisites** section.
56+
4. In the **Release** section, fill the **When Ready** box with an `X` and remove the line **After date: $DATE.**
57+
5. Create the PR as ready for approval (not a draft).
58+
59+
You can also use this as the contents for that PR description (remember to update the version and PR):
60+
61+
```
62+
## Summary
63+
64+
**[Supported Terminus and PHP Versions](https://docs.pantheon.io/terminus/supported-terminus)** - Include Terminus 3.6.1
65+
66+
Also, include new release note.
67+
```
68+
69+
## See Also
70+
71+
[Terminus' Usage of Semantic Versioning](https://getpantheon.atlassian.net/wiki/spaces/VULCAN/pages/154438719)
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Terminus release automation - discovery
2+
3+
# Tools to consider leveraging
4+
- https://github.com/pantheon-systems/plugin-release-actions/
5+
- https://github.com/googleapis/release-please
6+
- generate release PRs based on the conventionalcommits.org spec
7+
- https://github.com/autotag-dev/autotag
8+
9+
10+
# Notes
11+
- Technical concern: A step a github action takes that would normally trigger another workflow if done by a human will not trigger any workflows.
12+
- Releases should not be published automatically when code is merged to the default branch.
13+
- 'autotag' convention is to decide at feature development time whether that specific feature necessitates a major or minor release (vs just patch), and then when release automation is triggered, the automation decides what the next version number will be based on what is included
14+
15+
16+
# Theory
17+
- Each PR targeting the default branch defines whether it requires major/minor vs patch
18+
- Upon PR merge to default, automation drafts a new release PR
19+
- Updates the version in config/constants.yml
20+
- Updates the CHANGELOG
21+
- Phil's proposal: new branch is created from previous release, pushes it to github, creates new branch from 'dev' with above changes, PR targets previous release branch.
22+
- When we decide we want to create a new release, we "just" merge that PR
23+
- Creates the new tag
24+
- Drafts the new release, with changelog
25+
- Creates new "back to dev" PR, bumping the version number to the `next.patch-dev` in config/constants.yml and CHANGELOG
26+
- potentially this could not be a PR, but a direct push to default (by automation)
27+
- Publishing release (no longer draft) fires new automation
28+
- Creates the PR against homebrew
29+
- Creates a PR to update documentation repo
30+
- Create a PR to draft a "release note" in documention repo
31+
- Note: this would make the default branch
32+
- Move the 2 approvals requirement from PR merge to default to the creation of a release
33+
- Potential pitfall: if the release branch is long-living you'll need to preserve git history when you merge things back to "dev"

0 commit comments

Comments
 (0)