-
-
Notifications
You must be signed in to change notification settings - Fork 291
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
Drop lerna #4258
Drop lerna #4258
Changes from 11 commits
1bfeea2
7873c5f
44d24e9
93bca27
2de2333
c245e09
cd7a5d3
72e435b
6153be2
c81a678
47fc216
6e529b5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,54 +49,12 @@ jobs: | |
echo "::set-output name=version::$VERSION" | ||
echo PACKAGE_VERSION $PACKAGE_VERSION GITHUB_SHA $GITHUB_SHA VERSION $VERSION | ||
|
||
- name: Change and commit version | ||
# Write version before publishing so it's picked up by `lerna publish from-package`. | ||
# It must also be committed to ensure a clean git tree, otherwise `lerna publish` errors. | ||
# This "temp" commit doesn't change the actually release commit which is captured above. | ||
# git-data is also correct, since it's generated at build time, before `lerna version` run. | ||
run: | | ||
node_modules/.bin/lerna version ${{ steps.version.outputs.version }} \ | ||
--force-publish \ | ||
--exact \ | ||
--yes \ | ||
--no-git-tag-version | ||
|
||
git config user.name 'temp' | ||
git config user.email '[email protected]' | ||
git commit -am "${{ steps.version.outputs.version }}" | ||
- name: Set dev version | ||
# Set all mono-repo packages to the same new version. Update their dependency versions too | ||
run: node scripts/release/set_version.mjs ${{ steps.version.outputs.version }} exact | ||
|
||
- name: Publish to npm registry | ||
# Note: before https://github.com/ChainSafe/lodestar/commit/28e2c74cf0f1bede8b09c8c9fec26f54b367e3fd | ||
# We used `lerna publish --canary` option. However, since we now publish must version on branches, | ||
# i.e. v0.35.x branch, lerna fails to detect the latest version and publishes canary versions as | ||
# `0.34.0-dev.173+28e2c74cf0` instead of `0.36.0-dev.4+28e2c74cf0`, which creates confusion. | ||
# | ||
# --no-git-reset: | ||
# Do not delete code version artifacts so the next step can pick the version | ||
# | ||
# --dist-tag next: | ||
# Make this dev version installable with `@next` | ||
# | ||
# --preid dev: | ||
# Tag version with `dev` instead of `alpha` | ||
# | ||
# --force-publish: | ||
# lerna doesn't want to publish anything otherwise - "lerna success No changed packages | ||
# to publish" | ||
# --exact | ||
# lerna will link the dependencies of monorepo packages without ^ operator as npm | ||
# is apparently bad at resolving ^ dependencies of the canary versions. For e.g | ||
# @chainsafe/lodestar@^0.34.0-dev.4 resolves to => 0.34.0 | ||
# | ||
# NOTE: Using --preid dev.$(git rev-parse --short=7 HEAD) results in `0.24.3-dev.3ddb91d.0+3ddb91d` | ||
run: | | ||
node_modules/.bin/lerna publish from-package \ | ||
--yes \ | ||
--no-verify-access \ | ||
--dist-tag next \ | ||
--no-git-reset \ | ||
--force-publish \ | ||
--exact | ||
run: node scripts/release/publish.mjs next | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
outputs: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,29 +88,12 @@ jobs: | |
release_name: Release ${{ needs.tag.outputs.tag }} | ||
prerelease: true | ||
|
||
- name: Change and commit version | ||
# Write version before publishing so it's picked up by `lerna publish from-package`. | ||
# It must also be committed to ensure a clean git tree, otherwise `lerna publish` errors. | ||
# This "temp" commit doesn't change the actually release commit which is captured above. | ||
# git-data is also correct, since it's generated at build time, before `lerna version` run. | ||
run: | | ||
node_modules/.bin/lerna version ${{ needs.tag.outputs.version }} \ | ||
--force-publish \ | ||
--exact \ | ||
--yes \ | ||
--no-git-tag-version | ||
|
||
git config user.name 'temp' | ||
git config user.email '[email protected]' | ||
git commit -am "${{ needs.tag.outputs.version }}" | ||
|
||
# From https://github.com/lerna/lerna/issues/2404 | ||
- run: echo //registry.npmjs.org/:_authToken=${NPM_TOKEN} > .npmrc | ||
env: | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
- name: Set rc version | ||
# Set all mono-repo packages to the same new version. Update their dependency versions too | ||
run: node scripts/release/set_version.mjs ${{ steps.version.outputs.version }} exact | ||
|
||
- name: Publish to npm registry | ||
run: yarn run release:publish --dist-tag rc | ||
run: node scripts/release/publish.mjs rc | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,17 +56,11 @@ | |
"scripts": { | ||
"clean": "rm -rf lib && rm -f *.tsbuildinfo", | ||
"build": "tsc -p tsconfig.build.json", | ||
"build:typedocs": "typedoc --exclude src/index.ts --out typedocs src", | ||
"build:release": "yarn clean && yarn run build && yarn run build:typedocs", | ||
"check-build": "node -e \"(async function() { await import('./lib/index.js') })()\"", | ||
"check-types": "tsc", | ||
"coverage": "codecov -F lodestar-api", | ||
"lint": "eslint --color --ext .ts src/ test/", | ||
"lint:fix": "yarn run lint --fix", | ||
"pretest": "yarn run check-types", | ||
"test": "yarn test:unit && yarn test:e2e", | ||
"test:unit": "nyc --cache-dir .nyc_output/.cache -e .ts mocha 'test/unit/**/*.test.ts'", | ||
"check-readme": "typescript-docs-verifier" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. CI only items like |
||
"test:e2e": "echo 'n/a'" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yarn v1 |
||
}, | ||
"dependencies": { | ||
"@lodestar/config": "^0.39.0", | ||
|
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 hardcoded list is sorted topologically. Yarn v1 does not support topological inference out of the box, so this does the trick. Long term we can switch to newer versions of yarn that do this automatically.