-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path.xtravis.yml
More file actions
164 lines (140 loc) · 4.13 KB
/
.xtravis.yml
File metadata and controls
164 lines (140 loc) · 4.13 KB
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
# To create a release
# git checkout master
# git pull
# npm test
# Edit version in package.json to X.Y.Z
# npm run version
# The next command is only needed if tag already exists
# git tag -d vX.Y.Z; git push --delete origin vX.Y.Z
# Make final commit
# git commit -a -m "Final X.Y.Z commit"
# git push
# git checkout deploy
# git merge -X theirs origin/master --squash
# git commit -a -m "vX.Y.Z Release"
# git push
# git checkout master
# Create docker release
# cd /tmp; git clone https://github.com/hapi-server/server-nodejs
# cd server-nodejs/pkg; make docker && make docker-test && make docker-release
# Manually bump version in package.json to next minor, e.g., X.Y.(Z+1)-beta.
env:
global:
- npm_ver0=`curl https://raw.githubusercontent.com/hapi-server/server-nodejs/master/package.json | grep version | head -1 | sed 's/^.*[^0-9]\([0-9]*\.[0-9]*\.[0-9]*\).*$/\1/'`
- npm_ver=v`curl https://raw.githubusercontent.com/hapi-server/server-nodejs/master/package.json | grep version | head -1 | sed 's/^.*[^0-9]\([0-9]*\.[0-9]*\.[0-9]*\).*$/\1/'`
- tgz=https://github.com/hapi-server/server-nodejs/releases/download
cache: false
before_install:
- npm install
- npm cache clean --force # needed?
- npm update hapi-server-verifier # b/c dependency is master branch
script:
- npm test
jobs:
include:
- os: linux
if: branch = master
language: node_js
node_js: "16"
python: "2.7"
branches:
only: master
- os: windows
if: branch = master
language: node_js
node_js: "16"
python: "2.7"
branches:
only: master
- os: osx
if: branch = master
language: node_js
node_js: "16"
python: "2.7"
branches:
only: master
- stage: deploy
if: branch = deploy
os: linux
language: generic
before_install: skip
script: skip
on:
branch: deploy
before_deploy:
- git config --local user.name "rweigel"
- git config --local user.email "rweigel@gmu.edu"
- npm i
- npm run package
- export TRAVIS_TAG=$npm_ver
- git tag $npm_ver
deploy:
provider: releases
on:
branch: deploy
api_key: $GITHUB_OAUTH_TOKEN
file_glob: true
file: pkg/dist/*
skip_cleanup: true
- stage: linux-x64
if: branch = deploy
os: linux
language: generic
before_install: skip
branches:
only:
- deploy
script: curl -O -L $tgz/$npm_ver/hapi-server-$npm_ver-linux-x64.tgz && tar zxf hapi-server-$npm_ver-linux-x64.tgz && cd hapi-server-$npm_ver && ls -l bin && bin/node test/server-test.js
- stage: darwin-x64
if: branch = deploy
os: osx
language: generic
before_install: skip
branches:
only:
- deploy
script: curl -O -L $tgz/$npm_ver/hapi-server-$npm_ver-darwin-x64.tgz && tar zxf hapi-server-$npm_ver-darwin-x64.tgz && cd hapi-server-$npm_ver && bin/node test/server-test.js
- stage: win-x64
if: branch = deploy
language: shell
os: windows
before_install: skip
branches:
only:
- deploy
script: curl -O -L $tgz/$npm_ver/hapi-server-$npm_ver-win-x64.zip; unzip -q hapi-server-$npm_ver-win-x64.zip; cd hapi-server-$npm_ver; bin/node test/server-test.js
- stage: npm-deploy
if: branch = deploy
os: linux
language: generic
before_install: skip
script: skip
branches:
only:
deploy
deploy:
provider: npm
email: '$NPM_EMAIL'
api_key: '$NPM_TOKEN'
on:
branch: deploy
skip_cleanup: true
- stage: npm-deploy-test
if: branch = deploy
language: node_js
node_js: "16"
os: linux
before_install: skip
git:
clone: false
install: npm uninstall "@hapi-server/server"; npm install -g "@hapi-server/server@$npm_ver0"
branches:
only:
- deploy
script: hapi-server test
notifications:
email:
recipients:
- rweigel@gmu.edu
on_success: change
on_failure: always