jsii-release 0.3.9 → 0.3.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/bin/publib-npm +30 -0
- package/package.json +1 -1
- package/package.json.bak +1 -1
package/README.md
CHANGED
|
@@ -86,6 +86,8 @@ npx publib-npm [DIR]
|
|
|
86
86
|
| `AWS_SECRET_ACCESS_KEY` | Optional | Secret access key that belongs to the AWS access key. |
|
|
87
87
|
| `AWS_ROLE_TO_ASSUME` | Optional | If AWS CodeArtifact is used as registry, an AWS role ARN to assume before authorizing. |
|
|
88
88
|
| `DISABLE_HTTPS` | Optional | Connect to the registry with HTTP instead of HTTPS (defaults to false). |
|
|
89
|
+
| `VERIFY_PUBLISHED` | Optional | If "true", wait until every published version is available from the registry before exiting. Use this when packages that depend on the published ones are published next. |
|
|
90
|
+
| `VERIFY_PUBLISHED_TIMEOUT_SECONDS` | Optional | How long to wait, in seconds, for the published versions to be available when `VERIFY_PUBLISHED` is set (defaults to 3600). Fails if they are not available in time. |
|
|
89
91
|
|
|
90
92
|
## Maven
|
|
91
93
|
|
package/bin/publib-npm
CHANGED
|
@@ -16,6 +16,8 @@ set -eu
|
|
|
16
16
|
# AWS_SECRET_ACCESS_KEY (optional): Secret access key that belongs to the AWS access key.
|
|
17
17
|
# AWS_ROLE_TO_ASSUME (optional): If AWS CodeArtifact is used as registry and need to assume role.
|
|
18
18
|
# DISABLE_HTTPS (optional): connect to the registry with HTTP instead of HTTPS (defaults to false)
|
|
19
|
+
# VERIFY_PUBLISHED (optional): if "true", wait until every published version is available from the registry
|
|
20
|
+
# VERIFY_PUBLISHED_TIMEOUT_SECONDS (optional): seconds to wait for the published versions to be available (defaults to 3600)
|
|
19
21
|
#
|
|
20
22
|
###
|
|
21
23
|
|
|
@@ -81,6 +83,13 @@ if [ -n "${NPM_ACCESS_LEVEL:-}" ]; then
|
|
|
81
83
|
echo "Publishing package with access level: ${NPM_ACCESS_LEVEL}"
|
|
82
84
|
fi
|
|
83
85
|
|
|
86
|
+
# verification timeout
|
|
87
|
+
verify_timeout_seconds="${VERIFY_PUBLISHED_TIMEOUT_SECONDS:-3600}"
|
|
88
|
+
if ! [[ "${verify_timeout_seconds}" =~ ^[0-9]+$ ]]; then
|
|
89
|
+
echo "Invalid VERIFY_PUBLISHED_TIMEOUT_SECONDS: ${verify_timeout_seconds}. Must be a number of seconds"
|
|
90
|
+
exit 1
|
|
91
|
+
fi
|
|
92
|
+
|
|
84
93
|
log=$(mktemp -d)/npmlog.txt
|
|
85
94
|
|
|
86
95
|
# Check for dry run
|
|
@@ -116,4 +125,25 @@ for file in ${dir}/**.tgz; do
|
|
|
116
125
|
fi
|
|
117
126
|
done
|
|
118
127
|
|
|
128
|
+
# The registry may not serve a version right after it was published (npmjs scans packages first,
|
|
129
|
+
# and larger packages take longer). Wait until it does, so that packages depending on it can be installed.
|
|
130
|
+
if [ "${VERIFY_PUBLISHED:-}" = "true" ]; then
|
|
131
|
+
deadline_seconds=$((SECONDS + verify_timeout_seconds))
|
|
132
|
+
|
|
133
|
+
for file in ${dir}/**.tgz; do
|
|
134
|
+
pkgdir=$(mktemp -d)
|
|
135
|
+
tar -xzf ${file} -C ${pkgdir} package/package.json
|
|
136
|
+
spec=$(node -p 'const p = require(process.argv[1]); `${p.name}@${p.version}`' ${pkgdir}/package/package.json)
|
|
137
|
+
until npm view ${spec} version --prefer-online > /dev/null 2>&1; do
|
|
138
|
+
if [ ${SECONDS} -ge ${deadline_seconds} ]; then
|
|
139
|
+
echo "ERROR: ${spec} is not available after ${verify_timeout_seconds} seconds"
|
|
140
|
+
exit 1
|
|
141
|
+
fi
|
|
142
|
+
echo "Waiting for ${spec} to be available..."
|
|
143
|
+
sleep 20
|
|
144
|
+
done
|
|
145
|
+
echo "${spec} is available"
|
|
146
|
+
done
|
|
147
|
+
fi
|
|
148
|
+
|
|
119
149
|
echo "SUCCESS"
|
package/package.json
CHANGED