Skip to content

Commit f3ef3d4

Browse files
authored
RCORE-2134 touch up the GHA release process based on the first full run (#7730)
* touch up the GHA release process based on the first full run * make the tag start with 'v' for consistency * improve the release documentation * add output steps and update docs
1 parent a5c36bb commit f3ef3d4

File tree

4 files changed

+20
-18
lines changed

4 files changed

+20
-18
lines changed

.github/workflows/make-release.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ jobs:
3131
uses: ncipollo/release-action@2c591bcc8ecdcd2db72b97d6147f871fcd833ba5 #! 1.14.0
3232
with:
3333
bodyFile: extracted_changelog.md
34-
name: ${{ steps.get-version.outputs.version }}
34+
name: Realm Core v${{ steps.get-version.outputs.version }}
3535
commit: ${{ github.base_ref }}
36-
tag: ${{ steps.get-version.outputs.version }}
36+
tag: v${{ steps.get-version.outputs.version }}
3737
token: ${{ secrets.GITHUB_TOKEN }}
3838
draft: false
3939
- name: Update Changelog
@@ -53,16 +53,12 @@ jobs:
5353
labels: no-jira-ticket
5454
add-paths: CHANGELOG.md
5555
commit-message: New changelog section to prepare for vNext
56-
- name: Merge Pull Request
57-
uses: juliangruber/merge-pull-request-action@9234b8714dda9a08f3d1df5b2a6a3abd7b695353 #! 1.3.1
58-
with:
59-
github-token: ${{ secrets.GITHUB_TOKEN }}
60-
number: ${{ steps.vnext-pr.outputs.pull-request-number }}
61-
method: squash
6256
- name: 'Post to #appx-releases'
6357
uses: realm/ci-actions/release-to-slack@fa20eb972b9f018654fdb4e2c7afb52b0532f907
6458
with:
6559
changelog: extracted_changelog.md
6660
sdk: Core
6761
webhook-url: ${{ secrets.SLACK_RELEASE_WEBHOOK }}
6862
version: ${{ steps.get-version.outputs.version }}
63+
- name: Output PR URL
64+
run: echo "Prepare vNext PR created: ${{ steps.vnext-pr.outputs.pull-request-url }}" >> $GITHUB_STEP_SUMMARY

.github/workflows/prepare-release.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ jobs:
2424
run: tools/release-init.sh ${{ inputs.version }}
2525
shell: bash
2626
- name: Create Release PR
27+
id: prepare-pr
2728
uses: peter-evans/create-pull-request@6d6857d36972b65feb161a90e484f2984215f83e #! 6.0.5
2829
with:
2930
branch: release/automated_v${{ inputs.version }}
@@ -32,8 +33,10 @@ jobs:
3233
body-path: changes-since-last-tag.txt
3334
labels: no-jira-ticket
3435
commit-message: Prepare for release ${{ inputs.version }}
35-
token: ${{ secrets.REALM_CI_PAT }}
36+
token: ${{ secrets.GITHUB_TOKEN }}
3637
add-paths: |
3738
dependencies.yml
3839
Package.swift
3940
CHANGELOG.md
41+
- name: Output PR URL
42+
run: echo "Prepare release PR created: ${{ steps.prepare-pr.outputs.pull-request-url }}" >> $GITHUB_STEP_SUMMARY

doc/development/how-to-release.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
The core release process is automated with github [actions](https://github.com/realm/realm-core/actions)
22

3-
1. Run the prepare-release action.
4-
- input the base branch that you would like to make a release from (usually this will be "master").
5-
- input the release version (eg. "10.14.7")
3+
1. Go to the prepare-release [action](https://github.com/realm/realm-core/actions/workflows/prepare-release.yml) and click the "Run workflow" dropdown.
4+
- Select the base branch that you would like to make a release from (usually this will be "master") in the drop down.
5+
- Enter the version of the new release (eg. "10.123.1" or "4.5.0-CustDemo")
66

77
2. This will create a PR, which you should look over and get someone else on the team to review. Verify the changelog by checking the PR description which has a list of commits since the last tag was made. If any changes are required, commit them to this PR's branch.
88

9-
3. When ready, merge the PR. You can squash if there are only "prepare release" changes, but use a "merge-commit" strategy if there are functional changes added manually to the PR. On merge, the "make-release" action will run. This takes care of:
10-
- Making a tag
11-
- Publishing the release on Github
12-
- Updating the Changelog
13-
- Announcing the release in the #appx-releases slack channel
9+
3. When ready, merge the PR. You can squash if there are only "prepare release" changes, but use a "merge-commit" strategy if there are functional changes added manually to the PR (note that if using a merge strategy, the last commit after merge will be the one tagged, so you may want to reorder the commits so that the 'prepare' commit comes last). On merge, the "make-release" action will run. This will:
10+
- Make a tag
11+
- Publish the release on Github
12+
- Open a PR to update the Changelog with the new template section
13+
- Announce the release in the #appx-releases slack channel
14+
15+
4. Find the newly generated PR that adds the new changelog section. Approve it and merge it.
1416

1517
## Previous process
1618

tools/release-init.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ sed -i.bak -e "/.*\[#????\](https.*/d" "${project_dir}/CHANGELOG.md"
5151
rm "${project_dir}/CHANGELOG.md.bak" || exit 1
5252

5353
# assumes that tags and history have been fetched
54-
git log $(git describe --tags --abbrev=0)..HEAD --oneline --no-merges > changes-since-last-tag.txt
54+
echo "commits since last tag:\n" > changes-since-last-tag.txt
55+
git log $(git describe --tags --abbrev=0)..HEAD --oneline --no-merges >> changes-since-last-tag.txt
5556
echo changes since last tag are
5657
cat changes-since-last-tag.txt
5758

0 commit comments

Comments
 (0)