Skip to content

Commit

Permalink
Update release instructions for pnpm (#2560)
Browse files Browse the repository at this point in the history
* Update release instructions for pnpm

* Attempt to provide automatic canary builds
  • Loading branch information
mfedderly authored Dec 30, 2023
1 parent e455f4f commit 135b898
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 22 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: prerelease

on:
push:
branches: [master]

jobs:
build:
strategy:
fail-fast: true
matrix:
node:
- 18
platform:
- ubuntu-latest
name: "${{matrix.platform}} / Node.js ${{ matrix.node }}"
runs-on: ${{matrix.platform}}

steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v2.4.0
with:
version: 8

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
registry-url: "https://registry.npmjs.org"
cache: "pnpm"

- run: npm whoami
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- run: pnpm install --frozen-lockfile

- run: pnpm test

- name: run publish
run: pnpm run publish:prerelease
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
30 changes: 8 additions & 22 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,35 +91,21 @@ it will create a new folder inside `packages` with a simple boilerplate for your

### Prerelease

- create a new branch with some name
- write up changelog changes (manually), commit that
- yarn lerna version --no-push --no-commit-hooks 6.2.0-alpha.2
This lets lerna update the package.json versions (and dependencies) and commits the result as well as adds a tag
--no-push because we can't push to master
--no-commit-hooks because otherwise the commit hooks will prevent the commit
- git push origin --follow-tags \$branch
- make PR
- merge PR
- re-fetch the new master and check it out locally
- yarn install
- yarn lerna publish --dist-tag prerelease --ignore-scripts from-package
- --dist-tag is important to avoid tagging this release as the stable release
- --ignore-scripts skips the build steps since they already ran during yarn install
- you will likely need to publish several times as your OTP expires
- you might get rate limited as well
- between publish attempts, you'll have to undo the gitHead changes in the package.json files
- Every merged PR should trigger an automatic canary release
- The version number is calculated by a combination of the output of `git describe` and the `publish:prerelease` script in the root package.json. Specifically having `major` is appropriate for the pre-7.0 development phase, but we should change it to `minor` after 7.0.0 is finally released.

### Release
- create new branch with some name
- write up changelog changes (manually), commit that
- make PR (don't merge)
- yarn lerna version --no-push --no-commit-hooks 6.2.0
- pnpm lerna version --no-push 7.0.0
- git push origin --follow-tags \$branch
- merge PR
- merge PR (do not squash or the tags won't transfer)
- re-fetch the new master and check it out locally
- yarn install
- yarn lerna publish --ignore-scripts from-package

- git clean -fdx (this will delete any unsaved local changes!)
- pnpm install
- pnpm test
- pnpm publish -r

## Documentation

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"lint:prettier": "prettier --check .",
"preinstall": "npx only-allow pnpm",
"prepare": "lerna run build && husky install",
"publish:prerelease": "lerna publish --force-publish --canary major --dist-tag prerelease --yes",
"test": "pnpm run lint && lerna run test && lerna run --scope @turf/turf last-checks"
},
"lint-staged": {
Expand Down

0 comments on commit 135b898

Please sign in to comment.