Skip to content

ci: Streamline Gitflow release process #7113

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/auto-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Gitflow - Auto prepare release
on:
pull_request:
types:
- closed
branches:
- master

# This workflow tirggers a release when merging a branch with the pattern `prepare-release/VERSION` into master.
jobs:
release:
runs-on: ubuntu-20.04
name: 'Prepare a new version'

steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.GH_RELEASE_PAT }}
fetch-depth: 0

# https://github.com/actions-ecosystem/action-regex-match
- uses: actions-ecosystem/action-regex-match@v2
id: version
with:
# Parse version from head branch
text: ${{ github.head_ref }}
# match: refs/heads/preprare-release/xx.xx.xx
regex: '^refs\/heads\/preprare-release\/(\d+\.\d+\.\d+)$'

- name: Prepare release
uses: getsentry/action-prepare-release@v1
if: github.event.pull_request.merged == true && steps.version.outputs.match != ''
env:
GITHUB_TOKEN: ${{ secrets.GH_RELEASE_PAT }}
with:
version: ${{ steps.version.outputs.match != '' }}
force: false
merge_target: master
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ jobs:
# Note: These next three have to be checked as strings ('true'/'false')!
is_develop: ${{ github.ref == 'refs/heads/develop' }}
is_release: ${{ startsWith(github.ref, 'refs/heads/release/') }}
is_gitflow_sync: ${{ github.head_ref == 'refs/heads/develop' || github.head_ref == 'refs/heads/master' }}
# When merging into master, or from master
is_gitflow_sync: ${{ github.head_ref == 'refs/heads/master' || github.ref == 'refs/heads/master' }}
has_gitflow_label:
${{ github.event_name == 'pull_request' && contains(steps.pr-labels.outputs.labels, ' Gitflow ') }}
force_skip_cache:
Expand Down
62 changes: 0 additions & 62 deletions .github/workflows/gitflow-sync-master.yml

This file was deleted.

16 changes: 8 additions & 8 deletions docs/publishing-a-release.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@ _These steps are only relevant to Sentry employees when preparing and publishing
**If you want to release a new SDK for the first time, be sure to follow the [New SDK Release Checklist](./new-sdk-release-checklist.md)**

1. Determine what version will be released (we use [semver](https://semver.org)).
2. Update [`CHANGELOG.md`](https://github.com/getsentry/sentry-javascript/edit/master/CHANGELOG.md) to add an entry for the next release number and a list of changes since the last release. (See details below.)
a. Merging the Changelog PR will automatically trigger a sync from `develop` -> `master`
3. Run the [Prepare Release](https://github.com/getsentry/sentry-javascript/actions/workflows/release.yml) workflow.
a. Wait for this until the sync to `master` is completed.
4. A new issue should appear in https://github.com/getsentry/publish/issues.
5. Ask a member of the [@getsentry/releases team](https://github.com/orgs/getsentry/teams/releases/members) to approve the release.
2. Create a branch `prepare-release/VERSION`, eg. `prepare-release/7.37.0`, off develop
3. Update [`CHANGELOG.md`](https://github.com/getsentry/sentry-javascript/edit/master/CHANGELOG.md) to add an entry for the next release number and a list of changes since the last release. (See details below.)
4. Create a PR towards `master` branch
5. When the PR is merged, it will automatically trigger the [Prepare Release](https://github.com/getsentry/sentry-javascript/actions/workflows/release.yml) on master.
6. A new issue should appear in https://github.com/getsentry/publish/issues.
7. Ask a member of the [@getsentry/releases team](https://github.com/orgs/getsentry/teams/releases/members) to approve the release.
a. Once the release is completed, a sync from `master` ->` develop` will be automatically triggered

## Updating the Changelog

1. Create a new branch.
1. Create a new branch `prepare-release/VERSION` off of `develop`, e.g. `prepare-release/7.37.1`.
2. Run `yarn changelog` and copy everything
3. Create a new section in the changelog, deciding based on the changes whether it should be a minor bump or a patch release.
4. Paste in the logs you copied earlier.
5. Delete any which aren't user-facing changes.
7. If any of the PRs are from external contributors, include underneath the commits `Work in this release contributed by <list of external contributors' GitHub usernames>. Thank you for your contributions!`. If there's only one external PR, don't forget to remove the final `s`. If there are three or more, use an Oxford comma. (It's in the Sentry styleguide!)
8. Commit, push, and open a PR with the title `meta: Update changelog for <fill in relevant version here>` against `develop` branch.
8. Commit, push, and open a PR with the title `meta(changelog): Update changelog for VERSION` against `master` branch.