-
Notifications
You must be signed in to change notification settings - Fork 319
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
Add release and mergeback workflows #510
Conversation
fe1dfe9
to
5100571
Compare
You can try out the new I have not been able to try the |
5100571
to
98bd32a
Compare
0104591
to
cc2df76
Compare
03ff062
to
8566f9b
Compare
cc2df76
to
b3104f5
Compare
b3104f5
to
f03bccd
Compare
133f209
to
14f5cf4
Compare
3e07ee2
to
99dd264
Compare
.github/update-release-branch.py
Outdated
@@ -71,6 +81,13 @@ def open_pr(repo, all_commits, short_main_sha, branch_name): | |||
body += ' - ' + get_truncated_commit_message(commit) | |||
body += ' (@' + commit.author.login + ')' | |||
|
|||
body += '\n\nPlease review the following:\n' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor: consider creating a list of lines, and then calling '\n'.join(lines)
.
17c3445
to
dda41ec
Compare
c56582a
to
87926c7
Compare
git commit -m "Update changelog and version after $VERSION" | ||
|
||
git push origin "$NEW_BRANCH" | ||
gh pr create --head "$NEW_BRANCH" --base "$BASE_BRANCH" --title "$PR_TITLE" --body "$PR_BODY" --reviewer "$DEFAULT_REVIEWER" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider making this a draft PR when "$GITHUB_EVENT_NAME" == "pull_request"
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good idea.
9190040
to
1efbebf
Compare
This commit ensures that the changelog is updated before a release with the correct date and version. Also, after a release, a mergeback PR is created to ensure that the changelog update and version bump is available in main.
1efbebf
to
800a951
Compare
Here's the latest PR that gets created: #526 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. A few minor comments, feel free to merge once addressed.
@@ -9,7 +9,8 @@ | |||
"test-debug": "ava src/** --serial --verbose --timeout=20m", | |||
"lint": "eslint --report-unused-disable-directives --max-warnings=0 . --ext .js,.ts", | |||
"lint-fix": "eslint --report-unused-disable-directives --max-warnings=0 . --ext .js,.ts --fix", | |||
"removeNPMAbsolutePaths": "removeNPMAbsolutePaths . --force" | |||
"removeNPMAbsolutePaths": "removeNPMAbsolutePaths . --force", | |||
"version": "cd runner && npm version patch && git add ." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is only for the runner? Should it also update the Action's package.json
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not exactly. This script ensures that when npm version ...
is called, the version
script runs and that also triggers the npm version
on the runner. So, both will be updated in tandem.
See npm help version
If preversion, version, or postversion are in the scripts property of the package.json, they will be executed as part of running npm version.
...
4. Run the version script. These scripts have access to the new version in package.json...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I see. So calling npm version
at the root will then invoke this script, which bumps the version in the runner. Makes sense.
Consider avoiding the git add .
here, and keeping that in the Actions workflow instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By running git add .
, this ensures that the version changes to the runner get included in the same commit as the version changes to the containing action. I could run git commit --amend
in the workflow, but that seems messier if someone is running the npm version
command manually.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it. Do you know which file it will touch? Perhaps just add the package.json
file then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
package.json
and package-lock.json
. It's pretty safe running add .
since the initial npm version
will fail if the working directory is not clean. I have a slight preference for keeping the .
since this will be more future proof if npm version
ever does start touching different files.
Also note that the invocation of npm version patch
in the runner
directory doesn't create a commit since commits are only created if the package.json
is in the root of the git repo.
2c06220
to
bdc51ca
Compare
Ensures that the runner version is bumped along with the action version.
bdc51ca
to
ea89b06
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update from main and !
This commit ensures that the changelog is updated before a release with
the correct date and version.
Also, after a release, a mergeback PR is created to ensure that the
changelog update and version bump is available in main.
Merge / deployment checklist