Skip to content

Commit

Permalink
RCORE-2134 touch up the GHA release process based on the first full r…
Browse files Browse the repository at this point in the history
…un (#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
  • Loading branch information
ironage authored May 31, 2024
1 parent a5c36bb commit f3ef3d4
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 18 deletions.
12 changes: 4 additions & 8 deletions .github/workflows/make-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ jobs:
uses: ncipollo/release-action@2c591bcc8ecdcd2db72b97d6147f871fcd833ba5 #! 1.14.0
with:
bodyFile: extracted_changelog.md
name: ${{ steps.get-version.outputs.version }}
name: Realm Core v${{ steps.get-version.outputs.version }}
commit: ${{ github.base_ref }}
tag: ${{ steps.get-version.outputs.version }}
tag: v${{ steps.get-version.outputs.version }}
token: ${{ secrets.GITHUB_TOKEN }}
draft: false
- name: Update Changelog
Expand All @@ -53,16 +53,12 @@ jobs:
labels: no-jira-ticket
add-paths: CHANGELOG.md
commit-message: New changelog section to prepare for vNext
- name: Merge Pull Request
uses: juliangruber/merge-pull-request-action@9234b8714dda9a08f3d1df5b2a6a3abd7b695353 #! 1.3.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
number: ${{ steps.vnext-pr.outputs.pull-request-number }}
method: squash
- name: 'Post to #appx-releases'
uses: realm/ci-actions/release-to-slack@fa20eb972b9f018654fdb4e2c7afb52b0532f907
with:
changelog: extracted_changelog.md
sdk: Core
webhook-url: ${{ secrets.SLACK_RELEASE_WEBHOOK }}
version: ${{ steps.get-version.outputs.version }}
- name: Output PR URL
run: echo "Prepare vNext PR created: ${{ steps.vnext-pr.outputs.pull-request-url }}" >> $GITHUB_STEP_SUMMARY
5 changes: 4 additions & 1 deletion .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
run: tools/release-init.sh ${{ inputs.version }}
shell: bash
- name: Create Release PR
id: prepare-pr
uses: peter-evans/create-pull-request@6d6857d36972b65feb161a90e484f2984215f83e #! 6.0.5
with:
branch: release/automated_v${{ inputs.version }}
Expand All @@ -32,8 +33,10 @@ jobs:
body-path: changes-since-last-tag.txt
labels: no-jira-ticket
commit-message: Prepare for release ${{ inputs.version }}
token: ${{ secrets.REALM_CI_PAT }}
token: ${{ secrets.GITHUB_TOKEN }}
add-paths: |
dependencies.yml
Package.swift
CHANGELOG.md
- name: Output PR URL
run: echo "Prepare release PR created: ${{ steps.prepare-pr.outputs.pull-request-url }}" >> $GITHUB_STEP_SUMMARY
18 changes: 10 additions & 8 deletions doc/development/how-to-release.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
The core release process is automated with github [actions](https://github.com/realm/realm-core/actions)

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

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.

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:
- Making a tag
- Publishing the release on Github
- Updating the Changelog
- Announcing the release in the #appx-releases slack channel
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:
- Make a tag
- Publish the release on Github
- Open a PR to update the Changelog with the new template section
- Announce the release in the #appx-releases slack channel

4. Find the newly generated PR that adds the new changelog section. Approve it and merge it.

## Previous process

Expand Down
3 changes: 2 additions & 1 deletion tools/release-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ sed -i.bak -e "/.*\[#????\](https.*/d" "${project_dir}/CHANGELOG.md"
rm "${project_dir}/CHANGELOG.md.bak" || exit 1

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

Expand Down

0 comments on commit f3ef3d4

Please sign in to comment.