-
Notifications
You must be signed in to change notification settings - Fork 363
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated automated release to support manual trigger (#1212)
Updating the release process to avoid depending on the context of the current PR, but instead rely on the branch based on the version found in the `.version` file, restoring behavior like we had when we published through Circle CI. - Add a `.version` file and configure Ship CLI to automatically bump the version - Update `get-version` to read from the `.version` file instead of the branch name. - Add an action to get the release notes instead of relying on the current PR associated with the workflow trigger. - No longer create a tag manually, but rely on `softprops/action-gh-release` to create the tag when we create the GitHub release. Note: Because the release-notes are multiline, I was unable to use GITHUB_OUTPUT, but had to resort to GITHUB_ENV instead, exposing the release notes as an environment variable.
- Loading branch information
1 parent
f073914
commit 0dda1ab
Showing
6 changed files
with
62 additions
and
48 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,38 @@ | ||
name: Return the release notes extracted from the PR body | ||
|
||
# | ||
# Returns the release notes from the content of a pull request linked to a release branch. It expects the branch name to be in the format release/vX.Y.Z, release/X.Y.Z, release/vX.Y.Z-beta.N. etc. | ||
# | ||
# TODO: Remove once the common repo is public. | ||
# | ||
inputs: | ||
version : | ||
required: true | ||
repo_name: | ||
required: false | ||
repo_owner: | ||
required: true | ||
token: | ||
required: true | ||
|
||
runs: | ||
using: composite | ||
|
||
steps: | ||
- uses: actions/github-script@v7 | ||
id: get_release_notes | ||
with: | ||
result-encoding: string | ||
script: | | ||
const { data: pulls } = await github.rest.pulls.list({ | ||
owner: process.env.REPO_OWNER, | ||
repo: process.env.REPO_NAME, | ||
state: 'all', | ||
head: `${process.env.REPO_OWNER}:release/${process.env.VERSION}`, | ||
}); | ||
core.exportVariable('RELEASE_NOTES', pulls[0].body) | ||
env: | ||
GITHUB_TOKEN: ${{ inputs.token }} | ||
REPO_OWNER: ${{ inputs.repo_owner }} | ||
REPO_NAME: ${{ inputs.repo_name }} | ||
VERSION: ${{ inputs.version }} |
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 was deleted.
Oops, something went wrong.
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,8 +1,13 @@ | ||
{ | ||
"files": { | ||
"src/version.ts": [], | ||
"README.md": ["{MAJOR}.{MINOR}"], | ||
"FAQ.md": ["{MAJOR}.{MINOR}.{PATCH}"] | ||
".version": [], | ||
"README.md": [ | ||
"{MAJOR}.{MINOR}" | ||
], | ||
"FAQ.md": [ | ||
"{MAJOR}.{MINOR}.{PATCH}" | ||
] | ||
}, | ||
"postbump": "npm run docs" | ||
} | ||
} |
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 @@ | ||
v2.1.2 |