Skip to content

Commit cd1b431

Browse files
committed
ci: add guardrails and add to publish
1 parent c730f97 commit cd1b431

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

.github/workflows/npm.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ jobs:
2222
registry-url: 'https://registry.npmjs.org'
2323
- run: npm ci
2424
- run: npm run build
25+
env:
26+
IS_PUBLISHING: 'YES'
2527
- run: npm publish --access=public
2628
env:
2729
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

scripts/build-for-publish.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,20 @@
11
#!/usr/bin/env bash
2-
set -euxo pipefail
2+
set -euo pipefail
33

44
# This script allows for emitting js and definitions from the typescript into
55
# the same import locations as the original files.
66
# When we adjust how we import the library we can move to a "dist" folder and
77
# explicit "exports".
88

9+
if [ "${IS_PUBLISHING:-}" != "YES" ]; then
10+
echo "This script is intended to prepare the directory for publishing"
11+
echo "and replaces files. If you only want to build the UI run \`npm run build-ui\`."
12+
echo "Otherwise set IS_PUBLISHING to \"YES\""
13+
exit 1
14+
fi
15+
16+
set -x
17+
918
REPO_ROOT="$(git rev-parse --show-toplevel)"
1019
cd "$REPO_ROOT"
1120

0 commit comments

Comments
 (0)