Skip to content

Commit 46c5e13

Browse files
author
kkuzmin
authored
Ps spec (#48)
* Add ps_spec.yml * Add .npmrc * update ps_spec
1 parent 9f4b473 commit 46c5e13

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package-lock=false

ps_spec.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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+

0 commit comments

Comments
 (0)