This repository has been archived by the owner on Dec 12, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(release): Add changelog script, autorelease action and docs for…
… publishing a release
- Loading branch information
1 parent
88b5645
commit 61256ad
Showing
8 changed files
with
3,049 additions
and
2,350 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: "Auto release" | ||
on: | ||
pull_request: | ||
types: | ||
- closed | ||
branches: | ||
- main | ||
|
||
# This workflow triggers a release when merging a branch with the pattern `prepare-release/VERSION` into main. | ||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
name: 'Prepare a new version' | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
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-regex | ||
with: | ||
# Parse version from head branch | ||
text: ${{ github.head_ref }} | ||
# match: preprare-release/xx.xx.xx | ||
regex: '^prepare-release\/(\d+\.\d+\.\d+)(?:-(alpha|beta|rc)\.\d+)?$' | ||
|
||
- name: Extract version | ||
id: get_version | ||
run: | | ||
version=${{ steps.version-regex.outputs.match }} | ||
version=${version/'prepare-release/'/''} | ||
echo "version=$version" >> $GITHUB_OUTPUT | ||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: 'package.json' | ||
cache: pnpm | ||
|
||
- name: Install dependencies | ||
run: pnpm install | ||
|
||
- name: Prepare release | ||
uses: getsentry/action-prepare-release@lms/write-config-branch | ||
if: github.event.pull_request.merged == true && steps.version-regex.outputs.match != '' && steps.get_version.outputs.version != '' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_RELEASE_PAT }} | ||
with: | ||
version: ${{ github.event.inputs.version }} | ||
force: ${{ github.event.inputs.force }} | ||
merge_target: main | ||
craft_config_from_merge_target: true |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
.idea | ||
node_modules | ||
tmp |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Publishing a Release | ||
|
||
_These steps are only relevant to Sentry employees when preparing and publishing a new release._ | ||
|
||
1. Run `pnpm changelog` on the `main` branch and determine what version will be released (we use | ||
[semver](https://semver.org)) | ||
2. Create a branch `prepare-release/VERSION`, e.g. `prepare-release/1.4.8`, off of main | ||
3. Update [`CHANGELOG.md`](https://github.com/getsentry/sentry-migr8/edit/main/CHANGELOG.md) to add an entry for | ||
the next release number and a list of changes since the last release. (See details below.) | ||
4. Open a PR with the title `meta(changelog): Update changelog for VERSION` against the `main` branch. | ||
5. **Be cautious!** The PR against `master` should be merged via "Merge Commit" | ||
6. When the PR is merged, it will automatically trigger the | ||
[Auto Release](https://github.com/getsentry/sentry-migr8/actions/workflows/auto-release.yml) on main. | ||
|
||
## Updating the Changelog | ||
|
||
1. Run `pnpm changelog` and copy everything. | ||
2. Create a new section in the changelog with the previously determined version number. | ||
3. Paste in the logs you copied earlier. | ||
4. Highlight any important changes with subheadings. | ||
5. 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!) | ||
6. Commit, push, and continue with step 4 from the previous section with the general instructions (above). | ||
|
This file contains 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
Oops, something went wrong.