This repository was archived by the owner on Apr 17, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathps_spec.yml
82 lines (65 loc) · 3.1 KB
/
ps_spec.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
version: 1.0
service_name: nepal-common
stages:
-
name: PR Test
when:
- pull_request
image: node:13
compute_size: small
commands:
- npm install
- echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list
- wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
- apt-get update && apt-get -y install google-chrome-stable
- export CHROME_BIN='/usr/bin/google-chrome'
- npm run test
- npm run lint
- npm run build
- npx madge --circular --extensions ts --ts-config tsconfig.json src
-
name: Master Push - Publish
when:
- push: ['master']
image: node:13
compute_size: small
commands:
- echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list
- wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
- apt-get update && apt-get -y install google-chrome-stable
- export CHROME_BIN='/usr/bin/google-chrome'
- |
set -ex
printenv
if [ -z "$NPM_TOKEN" ]
then
echo "\$NPM_TOKEN is empty"
exit 1
fi
#git config --global --add url."[email protected]:".insteadOf "https://github.com/"
echo //registry.npmjs.org/:_authToken="$NPM_TOKEN" > .npmrc
npm whoami
PKGNAME=$(node -e 'console.log(require("./package.json").name)')
PKGVERSION=$(node -e 'console.log(require("./package.json").version)')
V_VERSION=v$PKGVERSION
WORDCOUNT=$(npm view "${PKGNAME}@${PKGVERSION}" | wc -c)
#git tag -a $V_VERSION -m "$PKGNAME release $V_VERSION" HEAD
# Release section
curl -fsSL https://github.com/github/hub/raw/master/script/get | bash -s 2.14.2
GITHUB_TOKEN=$ALPS_GH_TOKEN
npm install
if [ "$WORDCOUNT" -eq 0 ]; then
echo "PUBLISHING $PKGNAME $PKGVERSION"
npm run build
# git push origin $V_VERSION
npm publish --access public
echo "Continuous Delivery release for ${PKGNAME}@${PKGVERSION}" > release_notes.txt
echo "CREATING RELEASE FOR ${PKGNAME}@${PKGVERSION}"
# Create a GitHub Release from master using release notes from release_notes.txt file
# See: https://hub.github.com/hub-release.1.html
bin/hub release create -F release_notes.txt -t $CODEBUILD_SOURCE_VERSION $V_VERSION
# End release section
else
echo "NOT PUBLISHING $PKGNAME $PKGVERSION"
fi
- echo done