@@ -169,6 +169,8 @@ build:macos:
169169 - if : $CI_COMMIT_BRANCH == 'staging' && $CI_COMMIT_TITLE !~ /^[0-9]+\.[0-9]+\.[0-9]+(?:-.*[0-9]+)?$/
170170 - if : $CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+(?:-.*[0-9]+)?$/
171171
172+ # TODO gh prelease with the native addon builds
173+ # TODO: THIS IS A LIBRARY PRERELEASE
172174build:prerelease :
173175 stage : build
174176 needs :
@@ -188,7 +190,7 @@ build:prerelease:
188190 after_script :
189191 - rm -f ./.npmrc
190192 rules :
191- # Only prerelease tag
193+ # Only npm prerelease tags
192194 - if : $CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+-.*[0-9]+$/
193195
194196integration:builds :
@@ -224,8 +226,16 @@ integration:builds:
224226 paths :
225227 - ./builds/
226228 rules :
227- - if : $CI_COMMIT_BRANCH == 'staging' && $CI_COMMIT_TITLE !~ /^[0-9]+\.[0-9]+\.[0-9]+(?:-.*[0-9]+)?$/
228- - if : $CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+(?:-.*[0-9]+)?$/
229+ - if : $CI_COMMIT_BRANCH == 'staging'
230+
231+ integration:deployment :
232+ stage : integration
233+ needs :
234+ - integration:builds
235+ script :
236+ - echo 'Perform service deployment for integration testing'
237+ rules :
238+ - if : $CI_COMMIT_BRANCH == 'staging'
229239
230240integration:nix :
231241 stage : integration
@@ -240,8 +250,7 @@ integration:nix:
240250 )"
241251 - $build_application/bin/typescript-demo-lib
242252 rules :
243- - if : $CI_COMMIT_BRANCH == 'staging' && $CI_COMMIT_TITLE !~ /^[0-9]+\.[0-9]+\.[0-9]+(?:-.*[0-9]+)?$/
244- - if : $CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+(?:-.*[0-9]+)?$/
253+ - if : $CI_COMMIT_BRANCH == 'staging'
245254
246255integration:docker :
247256 stage : integration
@@ -258,8 +267,7 @@ integration:docker:
258267 - image="$(docker load --input ./builds/*docker* | cut -d' ' -f3)"
259268 - docker run "$image"
260269 rules :
261- - if : $CI_COMMIT_BRANCH == 'staging' && $CI_COMMIT_TITLE !~ /^[0-9]+\.[0-9]+\.[0-9]+(?:-.*[0-9]+)?$/
262- - if : $CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+(?:-.*[0-9]+)?$/
270+ - if : $CI_COMMIT_BRANCH == 'staging'
263271
264272integration:linux :
265273 stage : integration
@@ -269,8 +277,7 @@ integration:linux:
269277 script :
270278 - for f in ./builds/*-linux-*; do "$f"; done
271279 rules :
272- - if : $CI_COMMIT_BRANCH == 'staging' && $CI_COMMIT_TITLE !~ /^[0-9]+\.[0-9]+\.[0-9]+(?:-.*[0-9]+)?$/
273- - if : $CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+(?:-.*[0-9]+)?$/
280+ - if : $CI_COMMIT_BRANCH == 'staging'
274281
275282integration:windows :
276283 stage : integration
@@ -281,8 +288,7 @@ integration:windows:
281288 script :
282289 - Get-ChildItem -File ./builds/*-win-* | ForEach {& $_.FullName}
283290 rules :
284- - if : $CI_COMMIT_BRANCH == 'staging' && $CI_COMMIT_TITLE !~ /^[0-9]+\.[0-9]+\.[0-9]+(?:-.*[0-9]+)?$/
285- - if : $CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+(?:-.*[0-9]+)?$/
291+ - if : $CI_COMMIT_BRANCH == 'staging'
286292
287293integration:macos :
288294 stage : integration
@@ -294,8 +300,94 @@ integration:macos:
294300 script :
295301 - for f in ./builds/*-macos-x64*; do "$f"; done
296302 rules :
297- - if : $CI_COMMIT_BRANCH == 'staging' && $CI_COMMIT_TITLE !~ /^[0-9]+\.[0-9]+\.[0-9]+(?:-.*[0-9]+)?$/
298- - if : $CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+(?:-.*[0-9]+)?$/
303+ - if : $CI_COMMIT_BRANCH == 'staging'
304+
305+ # This produces the GH release page with the application builds
306+ # MERGE with the LIBRARY prerelease, since it's all together now
307+ integration:prerelease :
308+ stage : integration
309+ needs :
310+ - integration:builds
311+ - integration:nix
312+ - integration:docker
313+ - integration:linux
314+ - integration:windows
315+ - integration:macos
316+ # Don't interrupt publishing job
317+ interruptible : false
318+ allow_failure : true
319+ script :
320+ - echo "Use gh to add application binaries to the GH release"
321+ rules :
322+ - if : $CI_COMMIT_BRANCH == 'staging'
323+
324+ integration:merge :
325+ stage : integration
326+ needs :
327+ - integration:nix
328+ - integration:docker
329+ - integration:linux
330+ - integration:windows
331+ - integration:macos
332+ script :
333+ - echo 'use gh to create and merge PR from staging to master'
334+ rules :
335+ - if : $CI_COMMIT_BRANCH == 'staging'
336+
337+ # the expectation is that you must have merged into master from staging to trigger this
338+ # if you directly push to master, you corrupt this entire process
339+ # because this will end up acquiring it from the latest builds from the same path
340+ # thus we prevent master branch, direct merging into master branch
341+
342+ release:deployment :
343+ stage : release
344+ needs :
345+ - project : $CI_PROJECT_PATH
346+ job : integration:builds
347+ ref : staging
348+ artifacts : true
349+ script :
350+ - echo 'Perform service deployment for production release'
351+ rules :
352+ - if : $CI_COMMIT_BRANCH == 'master'
353+
354+ # TODO: use gh to produce the final release tag and page with all binaries
355+ # TODO: use npm to produce the final npm erlease too
356+ release:distribution :
357+ stage : release
358+ needs :
359+ - release:deployment
360+ - project : $CI_PROJECT_PATH
361+ job : build:linux
362+ ref : staging
363+ artifacts : true
364+ - project : $CI_PROJECT_PATH
365+ job : build:windows
366+ ref : staging
367+ artifacts : true
368+ - project : $CI_PROJECT_PATH
369+ job : build:macos
370+ ref : staging
371+ artifacts : true
372+ - project : $CI_PROJECT_PATH
373+ job : integration:builds
374+ ref : staging
375+ artifacts : true
376+ # Don't interrupt publishing job
377+ interruptible : false
378+ allow_failure : true
379+ before_script :
380+ - echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ./.npmrc
381+ script :
382+ - >
383+ nix-shell --run '
384+ npm publish --access public;
385+ '
386+ after_script :
387+ - rm -f ./.npmrc
388+ rules :
389+ # Only npm release tags
390+ - if : $CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+$/
299391
300392# packages:
301393# stage: release
0 commit comments