-
Notifications
You must be signed in to change notification settings - Fork 384
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
Automate release notes generation #6187
Conversation
667ca54
to
5d2e6cf
Compare
The "Release Drafter / Update release draft" workflow is failing because the necessary config is not yet on the
|
Plugin builds for 3c87818 are ready 🛎️!
|
…nt/5520-release-automation * 'develop' of github.com:ampproject/amp-wp: Fix test_get_mu_plugins_data for WP 5.8 (#6434) Rename prop Remove the QA Tester plugin Bump eslint from 7.28.0 to 7.29.0 See if removing the expression syntax allows for the step conditionals to be evaluated correctly Update Gutenberg package dependencies Add test for amp-render[template] Update amphtml spec to 2106240350000 Bump sirbrillig/phpcs-variable-analysis in /qa-tester Bump optimize-css-assets-webpack-plugin from 6.0.0 to 6.0.1 Bump eslint-plugin-jsdoc from 34.6.1 to 35.4.0
I've added a npm script to allow for the release changelog to be generated locally as well. The only caveat is that you would need a GitHub PAT (with the permissions The script accepts the milestone to generate the changelog for and gets the token from the npm run generate-changelog -- <milestone name> |
bin/release-changelog/index.js
Outdated
|
||
const milestone = process.argv[ 2 ]; | ||
|
||
const token = process.env.GITHUB_TOKEN; |
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.
If token
is empty, should this raise an error to inform the user to add it to their environment?
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.
Yea that makes sense. I've added some logic to properly parse the args and validate them in 312f0d3.
description: 'The URL for uploading assets to the release' | ||
runs: | ||
using: 'node12' | ||
main: 'dist/index.js' |
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.
Where does this file come from? Forgive my ignorance.
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, nevermind. It comes from npm run build
for this sub-package.
if (matches && matches[1]) { | ||
[, tagName] = matches; | ||
} |
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.
if (matches && matches[1]) { | |
[, tagName] = matches; | |
} | |
if (!matches || !matches[1]) { | |
throw new Error( 'Unable to parse Version from plugin bootstrap PHP file.' ); | |
} | |
tagName = matches[1]; |
if (matches && matches[1]) { | ||
[, tagName] = matches; | ||
} | ||
|
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.
It might be worthwhile to do some checking of the milestone to make sure it matches:
if ( ! tagName.startsWith( tagName.substr(1) ) ) { | |
throw new Error( "Milestone mismatch with PHP plugin bootsrap version." ); | |
} | |
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.
Done in 752872d.
target_commitish: commitish | ||
}); | ||
core.info(`Created ${tagName} release`); | ||
} else { |
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 should check to see if release
is a draft
, and if not, throw an error. We don't want to accidentally update a previous release.
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.
Done in 5b6e433.
Looking forward to seeing this in action! |
# Conflicts: # package-lock.json
This pull request introduces 1 alert when merging 1a89432 into 6822183 - view on LGTM.com new alerts:
|
I guess this reflects an update to LGTM's audits, rather than a code change here. This PR didn't touch So the package conflicts just have to be fixed… again. 😬 |
# Conflicts: # package-lock.json # package.json
This pull request introduces 1 alert when merging 0c958d7 into 7dd4c1a - view on LGTM.com new alerts:
|
Hmm seems the error is back again. Wondering if it can be hidden permanently. |
This pull request introduces 1 alert when merging 718b950 into 7dd4c1a - view on LGTM.com new alerts:
|
This pull request introduces 1 alert when merging 3c87818 into 7dd4c1a - view on LGTM.com new alerts:
|
OK so according to the LGTM docs, one should be able to disable individual alerts by adding "suppression comments" to the source code, which I've done in 3c87818. One thing to note from that same doc:
So it's expected to still get alerts in the PR if the alert was disabled. |
Summary
See #5520
This PR adds a custom GHA that will create (or update) a release draft for the specified branch and milestone. A new GHA workflow has also been added that allows one to manually trigger the action.
The release name and tag are derived from
amp.php
, and the release notes are generated from the given milestone.The action also provides an output called
asset_upload_url
, that would allow other GHA jobs to upload release assets to the created release (which we can use to upload a production build of the plugin, for example).Screenshots
What it would look like when triggering the workflow:
An example of what the action logs:
An example of a draft release:
Checklist