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

Introduce changesets for npm version management #420

Merged
merged 7 commits into from Jul 7, 2022

Conversation

kachkaev
Copy link
Contributor

@kachkaev kachkaev commented Jul 5, 2022

https://github.com/changesets/changesets

Instructions

Standard releases

  1. Create N PRs with .changeset/*.md files in them (each file corresponds to a single CHANGELOG entry)

  2. Find latest PR named ‘version packages’ (e.g. Version Packages statelyai/xstate#3366)

  3. Review and merge that PR

  4. Wait for CI to pass

  5. Enjoy new versions!

Snapshot releases

Run these commands locally:

yarn changeset version --snapshot
yarn changeset publish --no-git-tag --snapshot

This flow should improve once changesets/changesets#855 is released. In the meantime, I can add a new manual GitHub action for snapshot releases (perhaps, in a follow-up PR).

UPD: Two fixes in the initial setup

@github-actions github-actions bot added area: dependencies Relates to third-party or otherwise imported dependencies (area) area: infra Relates to version control, CI, CD or IaC (area) labels Jul 5, 2022
"block-template": patch
---

Add `"private": true` to all three template `package.json` files
Copy link
Contributor Author

@kachkaev kachkaev Jul 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively, we can remove "packages/block-template/templates/*" from package.jsonworkspaces. Conceptually, templates are not packages as far as the monorepo is concerned. They are just file assets.

@@ -20,7 +20,7 @@ jobs:
if: ${{ github.event.inputs.confirmation }}
runs-on: ubuntu-20.04
steps:
- run: echo "https://registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
- run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
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 hope this can fix

npm ERR! code ENEEDAUTH
npm ERR! need auth This command requires you to be logged in to https://registry.npmjs.org/
npm ERR! need auth You need to authorize this machine using `npm adduser`

https://github.com/blockprotocol/blockprotocol/actions/runs/2621063593

@kachkaev kachkaev requested a review from CiaranMn July 6, 2022 07:51
@kachkaev kachkaev marked this pull request as ready for review July 6, 2022 07:51
jobs:
release:
runs-on: ubuntu-latest
if: github.repository == 'blockprotocol/blockprotocol'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's this about? Isn't it always?

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 saw this if in one repo that uses changesets (not sure I remember which one). This is a protection against running the pipeline in a fork.

@kachkaev kachkaev merged commit 9c38dcd into main Jul 7, 2022
@kachkaev kachkaev deleted the ak/introduce-changesets branch July 7, 2022 14:47
@github-actions github-actions bot mentioned this pull request Jul 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: dependencies Relates to third-party or otherwise imported dependencies (area) area: infra Relates to version control, CI, CD or IaC (area)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants