File tree Expand file tree Collapse file tree 2 files changed +47
-0
lines changed Expand file tree Collapse file tree 2 files changed +47
-0
lines changed Original file line number Diff line number Diff line change 1+ package-lock = false
Original file line number Diff line number Diff line change 1+ version : 1.0
2+ service_name : al-aws-collector-js
3+
4+ stages :
5+ -
6+ name : PR Test
7+ when :
8+ - pull_request
9+ image : node:12
10+ compute_size : small
11+ commands :
12+ - make test
13+
14+ -
15+ name : Master Push - Publish
16+ when :
17+ - push : ['master']
18+ image : node:12
19+ compute_size : small
20+ commands :
21+ - |
22+ set -ex
23+ #git config --global --add url."[email protected] :".insteadOf "https://github.com/" 24+
25+ echo //registry.npmjs.org/:_authToken=$NPM_TOKEN > .npmrc
26+ npm whoami
27+
28+ PKGNAME=$(node -e 'console.log(require("./package.json").name)')
29+ PKGVERSION=$(node -e 'console.log(require("./package.json").version)')
30+ V_VERSION=v$PKGVERSION
31+ WORDCOUNT=$(npm view "${PKGNAME}@${PKGVERSION}" | wc -c)
32+
33+ git tag -a $V_VERSION -m "$PKGNAME release $V_VERSION" HEAD
34+
35+ npm install
36+
37+ if [ "$WORDCOUNT" -eq 0 ]; then
38+ echo "PUBLISHING $PKGNAME $PKGVERSION"
39+ npm run lint
40+ git push origin $V_VERSION
41+ npm publish --access public
42+ else
43+ echo "NOT PUBLISHING $PKGNAME $PKGVERSION"
44+ fi
45+ - echo done
46+
You can’t perform that action at this time.
0 commit comments