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

Prepare custom version on next release #3990

Merged
merged 7 commits into from
May 11, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 14 additions & 10 deletions .github/workflows/release-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,20 @@ jobs:
if: steps.cache-deps.outputs.cache-hit == 'true'
# </common-build>

- name: Get version
id: version
run: |
PACKAGE_VERSION=$(node -p "require('./packages/lodestar/package.json').version")
Copy link
Contributor

Choose a reason for hiding this comment

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

looks like this command returns incorrect value as in https://github.com/ChainSafe/lodestar/runs/6338092886?check_suite_focus=true

Run VERSION=$(node -p "require('./packages/lodestar/package.json').version")
VERSION 0.34.0-dev.173+28e2c74cf0

so I'm afraid this time it'd get the wrong value too, can we test the output of this step in this branch?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should be fine because we run this now before lerna canary

Copy link
Member

Choose a reason for hiding this comment

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

export VERSION=${PACKAGE_VERSION}-dev.${GITHUB_SHA:0:10}
echo "::set-output name=version::$VERSION"
echo PACKAGE_VERSION $PACKAGE_VERSION GITHUB_SHA $GITHUB_SHA VERSION $VERSION
- name: Set version
run: node_modules/.bin/lerna version ${{ steps.version.outputs.version }} --no-git-tag-version --force-publish --yes
- name: Publish to npm registry
# Just use lerna publish with --canary option. Using 'from-package' ignore other options
# and only compares against the verison in package.json, and skips release if already
# published.
# 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
Expand All @@ -71,17 +81,11 @@ jobs:
#
# 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 --yes --no-verify-access \
node_modules/.bin/lerna publish ${{ steps.version.outputs.version }} --yes --no-verify-access \
--canary --dist-tag next --no-git-reset --force-publish \
--preid dev --exact
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Get version
id: version
run: |
VERSION=$(node -p "require('./packages/lodestar/package.json').version")
echo VERSION $VERSION
echo "::set-output name=version::$VERSION"
outputs:
version: ${{ steps.version.outputs.version }}

Expand Down
2 changes: 1 addition & 1 deletion RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export TAG=v0.34.0-beta.0 && git tag -a $TAG 9fceb02 -m "$TAG" && git push origi
4. The team creates a PR to bump `master` to the next version (in the example: `v0.35.0`) and continues releasing nightly builds.

```
lerna version minor --no-git-tag-version --force-publish
lerna version minor --no-git-tag-version --force-publish --yes
```

After 3-5 days of testing:
Expand Down