-
Notifications
You must be signed in to change notification settings - Fork 5k
/
Copy pathe2e.npm.publish.sh
executable file
·70 lines (54 loc) · 1.84 KB
/
e2e.npm.publish.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/usr/bin/env bash
# --------------------------------------------------------------------
# Publishes web3 to a local npm proxy registry in CI so the package
# can be E2E tested by installing it in another project
# --------------------------------------------------------------------
# Exit immediately on error
set -o errexit
if [ -z "$CI" ]; then
echo "======================================================================"
echo "This script publishes web3 to an npm proxy registry. Only run in CI."
echo "======================================================================"
exit 1
fi
# To model publication correctly, this script needs to run
# without web3's dev deps being installed. It installs
# what it needs here.
npm install -g [email protected]
npm install -g [email protected]
npm install -g lerna@^6.1.0
npm install -g typescript@^4.1
npm install -g webpack@^5.75.0 webpack-cli@^5
# Launch npm proxy registry and save pid to kill server (req. in Windows env)
verdaccio --config verdaccio.yml &
VERDACCIO_PID=$!
echo "VERDACCIO_PID=$VERDACCIO_PID" > verdaccio_pid
npx wait-port 4873
# `npm add user`
curl -XPUT \
-H "Content-type: application/json" \
-d '{ "name": "test", "password": "test" }' \
'http://localhost:4873/-/user/org.couchdb.user:test'
# `npm login`
npm-auth-to-token \
-u test \
-p test \
-e [email protected] \
-r http://localhost:4873
# Lerna version
lerna version minor \
--force-publish=* \
--no-git-tag-version \
--no-push \
--yes
# Set identity prior to publishing (necessary for Windows)
git config user.email "[email protected]"
git config user.name "Your Name"
# Commit changes because lerna checks git before
git commit -a -m 'virtual-version-bump'
# Lerna publish to e2e tag
lerna publish from-package \
--dist-tag e2e \
--registry http://localhost:4873 \
--ignore-scripts \
--yes