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
chore: use release please #5446
Conversation
@@ -217,7 +217,7 @@ | |||
"scripts": { | |||
"dependencies": "node scripts/bundle-and-gitignore-deps.js && node scripts/dependency-graph.js", | |||
"dumpconf": "env | grep npm | sort | uniq", | |||
"preversion": "bash scripts/update-authors.sh && git add AUTHORS && git commit -m \"chore: update AUTHORS\" || true", | |||
"authors": "bash scripts/update-authors.sh", |
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.
The action takes care of committing anything that gets touched via npm run rp-pull-request
so we don't need to commit it here anymore.
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.
I also renamed this from preversion
since we won't manually be running npm version
anymore for releases. Since it gets called from an action I opted not to name it anything prefixed with pre
or post
since that might signal it gets called automatically.
@@ -250,7 +251,8 @@ | |||
"templateOSS": { | |||
"rootRepo": false, | |||
"rootModule": false, | |||
"version": "3.7.1" | |||
"version": "3.8.0", | |||
"releaseTest": "release.yml" |
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 a template-oss escape hatch I added so release-please.yml
can do a workflow_call
to any other action. The root cli package isn't under template-oss control so we manage this file ourselves and let the template-oss controlled release-please.yml
call it.
@@ -1,5 +1,9 @@ | |||
{ | |||
"separate-pull-requests": true, | |||
"bootstrap-sha": "141faf0c19eae382d0e19833129f5545fc2355c8", |
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 a one time config value needed to tell release-please
how far back to look for the previous release. It can be deleted after this PR is merged.
@@ -27,6 +31,9 @@ | |||
} | |||
], | |||
"packages": { | |||
".": { | |||
"package-name": "" |
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.
We set this to an empty string since we tag cli releases with only the version and not any name (eg v8.0.0
and not npm: v8.0.0
). This enables release-please to find our old manual releases.
console.log(release) | ||
} | ||
|
||
main(process.argv.slice(2)) |
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.
The relevant parts of this file have been moved to template-oss
. The cool part is we now use our custom changelog in every package.
@@ -7,7 +7,7 @@ const fs = require('fs') | |||
|
|||
// To re-create npm-cli-repos.txt run: | |||
/* eslint-disable-next-line max-len */ | |||
// gh api "/graphql" -F query='query { search (query: "org:npm topic:npm-cli", type: REPOSITORY, first:100) { nodes { ... on Repository { name } } } }' --jq '.data.search.nodes[].name'|sort | |||
// npx --package=@npmcli/stafftools@latest gh repos --json | json -a name | sort > scripts/npm-cli-repos.txt |
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.
"There's a stafftool for that" - me, probably
.catch(err => { | ||
console.error(err) | ||
process.exitCode = 1 | ||
}) |
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 goes away too since release-please
handles all of our changelog for us now.
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
npm run rp-release --ignore-scripts --if-present -ws -iwr |
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.
Future idea is that this hook could run .github/workflows/create-cli-deps-pr.yml
and trigger a docs site deploy. But there is enough churn here that I'm leaving this for a future effort.
03fef31
to
16f5ccd
Compare
No description provided.