-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Yarn publish nightlies and verdaccio (#6975)
* Yarn publish nightlies and verdaccio
- Loading branch information
1 parent
10c31a7
commit c5a45b2
Showing
4 changed files
with
21 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -98,6 +98,7 @@ publish: build | |
yarn publish | ||
|
||
publish-nightly: build | ||
yarn version:nightly | ||
yarn publish:nightly | ||
|
||
build: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
#!/usr/bin/env bash | ||
|
||
port=4000 | ||
# usually defaults to https://registry.npmjs.com/ | ||
original_registry=`npm get registry` | ||
registry="http://localhost:$port" | ||
output="output.out" | ||
|
@@ -22,10 +23,11 @@ function cleanup { | |
rm -rf storage/ ~/.config/verdaccio/storage/ $output | ||
if [ "$commit_to_revert" != "HEAD" ]; | ||
then | ||
git tag -d $(git tag -l) | ||
git fetch | ||
git reset --hard $commit_to_revert | ||
npm set registry $original_registry | ||
yarn config set npmPublishRegistry $original_registry | ||
yarn config set npmRegistryServer $original_registry | ||
fi | ||
else | ||
# lsof doesn't work in circleci | ||
|
@@ -48,6 +50,13 @@ grep -q 'http address' <(tail -f $output) | |
|
||
# Login as test user | ||
yarn npm-cli-login -u abc -p abc -e '[email protected]' -r $registry | ||
yarn config set npmPublishRegistry $registry | ||
yarn config set npmRegistryServer $registry | ||
yarn config set unsafeHttpWhitelist localhost | ||
yarn config set npmAlwaysAuth true | ||
npm set registry $registry | ||
# Pause is important so that the username isn't interpreted as both username and password | ||
(echo "abc"; sleep 2; echo "abc") | yarn npm login | ||
|
||
if [ "$ci" = true ]; | ||
then | ||
|
@@ -56,21 +65,13 @@ then | |
fi | ||
|
||
# Bump all package versions (allow publish from current branch but don't push tags or commit) | ||
yarn lerna version minor --force-publish --allow-branch `git branch --show-current` --no-push --yes | ||
commit_to_revert="HEAD~1" | ||
yarn workspaces foreach --all --no-private version minor --deferred | ||
yarn version apply --all | ||
|
||
if [ "$ci" = true ]; | ||
then | ||
# Get rid of npmrc file generated by install since it will block lerna publish | ||
git checkout -- . | ||
fi | ||
commit_to_revert="HEAD~0" | ||
|
||
# Publish packages to verdaccio | ||
yarn lerna publish from-package --registry $registry --yes | ||
|
||
# set the npm registry because that will set it at a higher level, making local testing easier | ||
npm set registry $registry | ||
yarn config set npmRegistryServer $registry | ||
yarn workspaces foreach --all --no-private -pt npm publish | ||
|
||
if [ "$ci" = true ]; | ||
then | ||
|
@@ -81,11 +82,11 @@ then | |
yarn config set npmRegistryServer $registry | ||
cd ../.. | ||
# build prod docs with a public url of /reactspectrum/COMMIT_HASH_BEFORE_PUBLISH/verdaccio/docs | ||
PUBLIC_URL=/reactspectrum/`git rev-parse HEAD~1`/verdaccio/docs make website-production | ||
PUBLIC_URL=/reactspectrum/`git rev-parse HEAD~0`/verdaccio/docs make website-production | ||
|
||
# Rename the dist folder from dist/production/docs to verdaccio_dist/COMMIT_HASH_BEFORE_PUBLISH/verdaccio/docs | ||
# This is so we can have verdaccio build in a separate stream from deploy and deploy_prod | ||
verdaccio_path=verdaccio_dist/`git rev-parse HEAD~1`/verdaccio | ||
verdaccio_path=verdaccio_dist/`git rev-parse HEAD~0`/verdaccio | ||
mkdir -p $verdaccio_path | ||
mv dist/production/docs $verdaccio_path | ||
|
||
|
c5a45b2
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.
Verdaccio builds:
CRA Test App
NextJS Test App
RAC Tailwind Example
RAC Spectrum + Tailwind Example
CRA Test App Size
NextJS App Size
Publish stats
Size diff since last release
Docs
Storybook
S2 Storybook
c5a45b2
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.
Verdaccio builds:
CRA Test App
NextJS Test App
RAC Tailwind Example
RAC Spectrum + Tailwind Example
CRA Test App Size
NextJS App Size
Publish stats
Size diff since last release
Docs
Storybook
S2 Storybook