-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Expand file tree
/
Copy pathpublish.sh
More file actions
executable file
·26 lines (21 loc) · 943 Bytes
/
publish.sh
File metadata and controls
executable file
·26 lines (21 loc) · 943 Bytes
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
#!/bin/bash
set -e
# This script is run by each package in the packages/ folder
# Configure npm authentication
# NPM_TOKEN is set in cloudbuild.yaml
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >.npmrc
# Decide the correct version and npm tag.
if [ -n "$TAG_NAME" ]; then
echo "Git Tag detected: $TAG_NAME"
NPM_TAG=beta
# Delete the 'v' from the tag to get the version to publish
OVERRIDE_VERSION=${TAG_NAME/v/}
else
echo "No Git Tag detected (Commit trigger)"
NPM_TAG=exp
OVERRIDE_VERSION=$(node -e "console.log(require('./package.json').version)")-exp.$SHORT_SHA
fi
echo "Publishing version $OVERRIDE_VERSION with npm tag '$NPM_TAG' for commit $COMMIT_SHA."
npm --no-git-tag-version --allow-same-version version $OVERRIDE_VERSION
# pnpm publish is required here to prevent workspace stuff from being published with the package
pnpm publish --tag $NPM_TAG --access=public --registry https://wombat-dressing-room.appspot.com