Skip to content
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

Merged
merged 1 commit into from Aug 31, 2022
Merged

chore: use release please #5446

merged 1 commit into from Aug 31, 2022

Conversation

lukekarrys
Copy link
Contributor

No description provided.

@lukekarrys lukekarrys requested a review from a team as a code owner August 31, 2022 19:31
@@ -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",
Copy link
Contributor Author

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.

Copy link
Contributor Author

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"
Copy link
Contributor Author

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",
Copy link
Contributor Author

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": ""
Copy link
Contributor Author

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))
Copy link
Contributor Author

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
Copy link
Contributor Author

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
})
Copy link
Contributor Author

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
Copy link
Contributor Author

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.

@lukekarrys lukekarrys merged commit 6f08157 into latest Aug 31, 2022
@lukekarrys lukekarrys deleted the lk/release-please-pr branch August 31, 2022 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant