File tree 3 files changed +28
-4
lines changed
3 files changed +28
-4
lines changed Original file line number Diff line number Diff line change @@ -177,6 +177,13 @@ jobs:
177
177
name : npm-package
178
178
path : ./package.tar.gz
179
179
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
+ NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
185
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
186
+
180
187
# TODO: cache building yarn --production
181
188
# possibly 2m30s of savings(?)
182
189
# this requires refactoring our release scripts
Original file line number Diff line number Diff line change 2
2
set -euo pipefail
3
3
4
4
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
6
10
if ! is_env_var_set " TAG" ; then
7
- echo " TAG is not set. Cannot publish to npm without setting a tag"
11
+ echo " TAG is not set. Cannot publish to npm without setting a tag. "
8
12
exit 1
9
13
fi
10
- cd " $( dirname " $0 " ) /../.."
11
- source ./ci/lib.sh
14
+
15
+ # Needed ot publish on NPM
16
+ if ! is_env_var_set " NPM_TOKEN" ; then
17
+ echo " NPM_TOKEN is not set. Cannot publish to npm without credentials."
18
+ exit 1
19
+ fi
20
+
21
+ # Needed to use GitHub API
22
+ if ! is_env_var_set " GITHUB_TOKEN" ; then
23
+ echo " GITHUB_TOKEN is not set. Cannot download npm release artifact without GitHub credentials."
24
+ exit 1
25
+ fi
26
+
27
+ echo " using tag: $TAG "
12
28
13
29
if [[ ${CI-} ]]; then
14
30
echo " //registry.npmjs.org/:_authToken=${NPM_TOKEN} " > ~ /.npmrc
Original file line number Diff line number Diff line change 23
23
"test:scripts" : " ./ci/dev/test-scripts.sh" ,
24
24
"package" : " ./ci/build/build-packages.sh" ,
25
25
"postinstall" : " ./ci/dev/postinstall.sh" ,
26
+ "publish:npm:dev" : " ./ci/steps/publish-npm-dev.sh" ,
26
27
"_audit" : " ./ci/dev/audit.sh" ,
27
28
"fmt" : " ./ci/dev/fmt.sh" ,
28
29
"lint" : " ./ci/dev/lint.sh" ,
You can’t perform that action at this time.
0 commit comments