@@ -48,23 +48,21 @@ check:lint:
48
48
npm run lint;
49
49
'
50
50
rules :
51
- - if : $CI_COMMIT_TAG
52
- when : manual
53
- - if : $CI_COMMIT_BRANCH = = 'master'
51
+ - if : $CI_COMMIT_BRANCH =~ /^feature.+/
52
+ - if : $CI_COMMIT_BRANCH == 'staging'
53
+ - if : $CI_COMMIT_BRANCH && $CI_COMMIT_BRANCH ! = 'master'
54
54
when : manual
55
- - when : always
56
55
57
56
check:nix-dry :
58
57
stage : check
59
58
needs : []
60
59
script :
61
60
- nix-build -v -v --dry-run ./release.nix
62
61
rules :
63
- - if : $CI_COMMIT_TAG
64
- when : manual
65
- - if : $CI_COMMIT_BRANCH = = 'master'
62
+ - if : $CI_COMMIT_BRANCH =~ /^feature.+/
63
+ - if : $CI_COMMIT_BRANCH == 'staging'
64
+ - if : $CI_COMMIT_BRANCH && $CI_COMMIT_BRANCH ! = 'master'
66
65
when : manual
67
- - when : always
68
66
69
67
check:test :
70
68
stage : check
@@ -81,19 +79,15 @@ check:test:
81
79
junit :
82
80
- ./tmp/junit.xml
83
81
rules :
84
- - if : $CI_COMMIT_TAG
85
- when : manual
86
- - if : $CI_COMMIT_BRANCH == 'master'
82
+ - if : $CI_COMMIT_BRANCH =~ /^feature.+/
83
+ - if : $CI_COMMIT_BRANCH && $CI_COMMIT_BRANCH != 'master' && $CI_COMMIT_BRANCH != 'staging'
87
84
when : manual
88
- # This job will be overridden by `build:linux`
89
- - if : $CI_COMMIT_BRANCH == 'staging'
90
- when : never
91
- - when : always
92
85
93
86
build:linux :
94
87
stage : build
95
88
needs :
96
- - check:lint
89
+ - job : check:lint
90
+ optional : true
97
91
script :
98
92
- >
99
93
nix-shell --run '
@@ -107,17 +101,16 @@ build:linux:
107
101
- ./tmp/junit.xml
108
102
paths :
109
103
- ./prebuilds/
104
+ # Only the build:linux preserves the dist
105
+ - ./dist
110
106
rules :
111
- - if : $CI_COMMIT_TAG
112
- when : manual
113
- - if : $CI_COMMIT_BRANCH == 'master'
114
- when : manual
115
107
- if : $CI_COMMIT_BRANCH == 'staging'
116
108
117
109
build:windows :
118
110
stage : build
119
111
needs :
120
- - check:lint
112
+ - job : check:lint
113
+ optional : true
121
114
tags :
122
115
- windows
123
116
before_script :
@@ -138,16 +131,13 @@ build:windows:
138
131
paths :
139
132
- ./prebuilds/
140
133
rules :
141
- - if : $CI_COMMIT_TAG
142
- when : manual
143
- - if : $CI_COMMIT_BRANCH == 'master'
144
- when : manual
145
134
- if : $CI_COMMIT_BRANCH == 'staging'
146
135
147
136
build:macos :
148
137
stage : build
149
138
needs :
150
- - check:lint
139
+ - job : check:lint
140
+ optional : true
151
141
tags :
152
142
- shared-macos-amd64
153
143
image : macos-11-xcode-12
@@ -174,12 +164,30 @@ build:macos:
174
164
paths :
175
165
- ./prebuilds/
176
166
rules :
177
- - if : $CI_COMMIT_TAG
178
- when : manual
179
- - if : $CI_COMMIT_BRANCH == 'master'
180
- when : manual
181
167
- if : $CI_COMMIT_BRANCH == 'staging'
182
168
169
+ build:prerelease :
170
+ stage : build
171
+ needs :
172
+ - build:linux
173
+ - build:windows
174
+ - build:macos
175
+ # Don't interrupt publishing job
176
+ interruptible : false
177
+ allow_failure : true
178
+ before_script :
179
+ - echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ./.npmrc
180
+ script :
181
+ - >
182
+ nix-shell --run '
183
+ npm publish --tag staging --access public;
184
+ '
185
+ after_script :
186
+ - rm -f ./.npmrc
187
+ rules :
188
+ # Prerelease commit message
189
+ - if : $CI_COMMIT_BRANCH == 'staging' && $CI_COMMIT_TITLE =~ /^[0-9]+\.[0-9]+\.[0-9]+-.+/
190
+
183
191
integration:builds :
184
192
stage : integration
185
193
needs :
@@ -213,10 +221,6 @@ integration:builds:
213
221
paths :
214
222
- ./builds/
215
223
rules :
216
- - if : $CI_COMMIT_TAG
217
- when : manual
218
- - if : $CI_COMMIT_BRANCH == 'master'
219
- when : manual
220
224
- if : $CI_COMMIT_BRANCH == 'staging'
221
225
222
226
integration:nix :
@@ -232,10 +236,6 @@ integration:nix:
232
236
)"
233
237
- $build_application/bin/typescript-demo-lib
234
238
rules :
235
- - if : $CI_COMMIT_TAG
236
- when : manual
237
- - if : $CI_COMMIT_BRANCH == 'master'
238
- when : manual
239
239
- if : $CI_COMMIT_BRANCH == 'staging'
240
240
241
241
integration:docker :
@@ -253,10 +253,6 @@ integration:docker:
253
253
- image="$(docker load --input ./builds/*docker* | cut -d' ' -f3)"
254
254
- docker run "$image"
255
255
rules :
256
- - if : $CI_COMMIT_TAG
257
- when : manual
258
- - if : $CI_COMMIT_BRANCH == 'master'
259
- when : manual
260
256
- if : $CI_COMMIT_BRANCH == 'staging'
261
257
262
258
integration:linux :
@@ -267,10 +263,6 @@ integration:linux:
267
263
script :
268
264
- for f in ./builds/*-linux-*; do "$f"; done
269
265
rules :
270
- - if : $CI_COMMIT_TAG
271
- when : manual
272
- - if : $CI_COMMIT_BRANCH == 'master'
273
- when : manual
274
266
- if : $CI_COMMIT_BRANCH == 'staging'
275
267
276
268
integration:windows :
@@ -282,10 +274,6 @@ integration:windows:
282
274
script :
283
275
- Get-ChildItem -File ./builds/*-win-* | ForEach {& $_.FullName}
284
276
rules :
285
- - if : $CI_COMMIT_TAG
286
- when : manual
287
- - if : $CI_COMMIT_BRANCH == 'master'
288
- when : manual
289
277
- if : $CI_COMMIT_BRANCH == 'staging'
290
278
291
279
integration:macos :
@@ -298,10 +286,6 @@ integration:macos:
298
286
script :
299
287
- for f in ./builds/*-macos-x64*; do "$f"; done
300
288
rules :
301
- - if : $CI_COMMIT_TAG
302
- when : manual
303
- - if : $CI_COMMIT_BRANCH == 'master'
304
- when : manual
305
289
- if : $CI_COMMIT_BRANCH == 'staging'
306
290
307
291
# packages:
0 commit comments