Skip to content

Commit 4cf7b45

Browse files
committed
feat: add script to publish-npm-dev
1 parent d775c88 commit 4cf7b45

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

.github/workflows/ci.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,11 @@ jobs:
177177
name: npm-package
178178
path: ./package.tar.gz
179179

180+
- name: Publish npm package with dev tag
181+
run: yarn publish:npm:dev
182+
env:
183+
TAG: ${{ github.event.number }}-${{ github.event.pull_request.head.sha }}
184+
180185
# TODO: cache building yarn --production
181186
# possibly 2m30s of savings(?)
182187
# this requires refactoring our release scripts

ci/steps/publish-npm-dev.sh

+7-3
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,17 @@
22
set -euo pipefail
33

44
main() {
5-
# We need VERSION to bump the brew formula
5+
cd "$(dirname "$0")/../.."
6+
source ./ci/lib.sh
7+
source ./ci/steps/steps-lib.sh
8+
9+
# We need TAG to know what to publish under on npm
610
if ! is_env_var_set "TAG"; then
711
echo "TAG is not set. Cannot publish to npm without setting a tag"
812
exit 1
913
fi
10-
cd "$(dirname "$0")/../.."
11-
source ./ci/lib.sh
14+
15+
echo "using tag: $TAG"
1216

1317
if [[ ${CI-} ]]; then
1418
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"test:scripts": "./ci/dev/test-scripts.sh",
2424
"package": "./ci/build/build-packages.sh",
2525
"postinstall": "./ci/dev/postinstall.sh",
26+
"publish:npm:dev": "./ci/steps/publish-npm-dev.sh",
2627
"_audit": "./ci/dev/audit.sh",
2728
"fmt": "./ci/dev/fmt.sh",
2829
"lint": "./ci/dev/lint.sh",

0 commit comments

Comments
 (0)