1
1
#! /usr/bin/env bash
2
2
3
3
port=4000
4
+ # usually defaults to https://registry.npmjs.com/
4
5
original_registry=` npm get registry`
5
6
registry=" http://localhost:$port "
6
7
output=" output.out"
@@ -22,10 +23,11 @@ function cleanup {
22
23
rm -rf storage/ ~ /.config/verdaccio/storage/ $output
23
24
if [ " $commit_to_revert " != " HEAD" ];
24
25
then
25
- git tag -d $( git tag -l)
26
26
git fetch
27
27
git reset --hard $commit_to_revert
28
28
npm set registry $original_registry
29
+ yarn config set npmPublishRegistry $original_registry
30
+ yarn config set npmRegistryServer $original_registry
29
31
fi
30
32
else
31
33
# lsof doesn't work in circleci
@@ -48,6 +50,13 @@ grep -q 'http address' <(tail -f $output)
48
50
49
51
# Login as test user
50
52
yarn npm-cli-login -u abc -p abc -e
' [email protected] ' -r
$registry
53
+ yarn config set npmPublishRegistry $registry
54
+ yarn config set npmRegistryServer $registry
55
+ yarn config set unsafeHttpWhitelist localhost
56
+ yarn config set npmAlwaysAuth true
57
+ npm set registry $registry
58
+ # Pause is important so that the username isn't interpreted as both username and password
59
+ (echo " abc" ; sleep 2; echo " abc" ) | yarn npm login
51
60
52
61
if [ " $ci " = true ];
53
62
then
56
65
fi
57
66
58
67
# Bump all package versions (allow publish from current branch but don't push tags or commit)
59
- yarn lerna version minor --force-publish --allow-branch ` git branch --show-current ` --no-push --yes
60
- commit_to_revert= " HEAD~1 "
68
+ yarn workspaces foreach --all --no-private version minor --deferred
69
+ yarn version apply --all
61
70
62
- if [ " $ci " = true ];
63
- then
64
- # Get rid of npmrc file generated by install since it will block lerna publish
65
- git checkout -- .
66
- fi
71
+ commit_to_revert=" HEAD~0"
67
72
68
73
# Publish packages to verdaccio
69
- yarn lerna publish from-package --registry $registry --yes
70
-
71
- # set the npm registry because that will set it at a higher level, making local testing easier
72
- npm set registry $registry
73
- yarn config set npmRegistryServer $registry
74
+ yarn workspaces foreach --all --no-private -pt npm publish
74
75
75
76
if [ " $ci " = true ];
76
77
then
81
82
yarn config set npmRegistryServer $registry
82
83
cd ../..
83
84
# build prod docs with a public url of /reactspectrum/COMMIT_HASH_BEFORE_PUBLISH/verdaccio/docs
84
- PUBLIC_URL=/reactspectrum/` git rev-parse HEAD~1 ` /verdaccio/docs make website-production
85
+ PUBLIC_URL=/reactspectrum/` git rev-parse HEAD~0 ` /verdaccio/docs make website-production
85
86
86
87
# Rename the dist folder from dist/production/docs to verdaccio_dist/COMMIT_HASH_BEFORE_PUBLISH/verdaccio/docs
87
88
# This is so we can have verdaccio build in a separate stream from deploy and deploy_prod
88
- verdaccio_path=verdaccio_dist/` git rev-parse HEAD~1 ` /verdaccio
89
+ verdaccio_path=verdaccio_dist/` git rev-parse HEAD~0 ` /verdaccio
89
90
mkdir -p $verdaccio_path
90
91
mv dist/production/docs $verdaccio_path
91
92
0 commit comments