forked from seanmorris/php-wasm
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpublish-packages.sh
More file actions
executable file
·80 lines (60 loc) · 1.48 KB
/
publish-packages.sh
File metadata and controls
executable file
·80 lines (60 loc) · 1.48 KB
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
70
71
72
73
74
75
76
77
78
79
80
#!/usr/bin/env bash
NPM_TAG=${1};
OTP=${2};
if [ -z "${NPM_TAG}" ]; then {
echo "A tag is required.";
exit 1;}
fi
echo -e "Getting ready to publish to channel: \033[33m${NPM_TAG}\033[0m"
sleep 3;
# THIS SCRIPT SHOULD QUIT IMMEDIATELY UPON ERRORS
set -euo pipefail
ls packages | while read PACKAGE; do {
if [[ ${PACKAGE} == "sdl" ]]; then
continue;
fi;
echo -e "Checking package.json[files] in \033[1m${PACKAGE}\033[0m"
cd "packages/${PACKAGE}"
jq -r '.files | join("\n")' < package.json | while read FILE; do {
if [[ ${FILE} == php8.[01234]* ]]; then
continue;
fi;
if [[ ${FILE} == 'mapped/*' ]] || [[ ${FILE} == *.map ]]; then
continue;
fi;
if [[ ${FILE} == '*.wasm' ]] || [[ ${FILE} == *.map ]]; then
continue;
fi;
if [ ! -e ${FILE} ]; then
echo -e "\033[31mMISSING ${FILE} in ${PACKAGE}!\033[0m"
exit 1;
fi;
}; done;
cd "../..";
}; done
set -euo pipefail
ls packages | while read PACKAGE; do {
if [[ ${PACKAGE} == "sdl" ]]; then
continue;
fi;
cd "packages/${PACKAGE}"
echo -e "\033[33mChanged files in \033[1m${PACKAGE}:\033[0m";
npm diff --tag ${NPM_TAG} --diff-name-only || ( cd ../.. && continue )
cd "../.."
}; done;
ls packages | while read PACKAGE; do {
if [[ ${PACKAGE} == "sdl" ]]; then
continue;
fi;
cd "packages/${PACKAGE}"
if [[ "${NOT_DRY_RUN:-}" == "real" ]]; then
set -x
npm publish --tag ${NPM_TAG} --otp ${OTP} &
set +x
else
set -x
npm publish --tag ${NPM_TAG} --dry-run &
set +x
fi
cd "../.."
}; done;