@@ -199,6 +199,51 @@ build:macos:
199199 # Runs on tag pipeline where the tag is a prerelease or release version
200200 - if : $CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+(?:-.*[0-9]+)?$/
201201
202+ build:prerelease :
203+ stage : build
204+ needs :
205+ - build:linux
206+ - build:windows
207+ - build:macos
208+ # Don't interrupt publishing job
209+ interruptible : false
210+ before_script :
211+ - echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ./.npmrc
212+ script :
213+ - echo 'Publishing library prerelease'
214+ - >
215+ nix-shell --run '
216+ npm publish --tag prerelease --access public;
217+ '
218+ - >
219+ for d in prebuilds/*; do
220+ tar \
221+ --create \
222+ --verbose \
223+ --file="prebuilds/$(basename $d).tar" \
224+ --directory=prebuilds \
225+ "$(basename $d)";
226+ done
227+ - >
228+ nix-shell -I nixpkgs=./pkgs.nix --packages gitAndTools.gh --run '
229+ gh release \
230+ create "$CI_COMMIT_TAG" \
231+ prebuilds/*.tar \
232+ --title "${CI_COMMIT_TAG}-$(date -u +"%Y-%m-%dT%H:%M:%SZ")" \
233+ --notes "" \
234+ --prerelease \
235+ --target staging \
236+ --repo "$GH_PROJECT_PATH";
237+ '
238+ after_script :
239+ - rm -f ./.npmrc
240+ rules :
241+ # Only runs on tag pipeline where the tag is a prerelease version
242+ # This requires dependencies to also run on tag pipeline
243+ # However version tag comes with a version commit
244+ # Dependencies must not run on the version commit
245+ - if : $CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+-.*[0-9]+$/
246+
202247integration:merge :
203248 stage : integration
204249 needs :
@@ -229,3 +274,48 @@ integration:merge:
229274 - if : $CI_COMMIT_BRANCH == 'staging' && $CI_COMMIT_TITLE !~ /^[0-9]+\.[0-9]+\.[0-9]+(?:-.*[0-9]+)?$/
230275 # Runs on tag pipeline where the tag is a prerelease or release version
231276 - if : $CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+(?:-.*[0-9]+)?$/
277+
278+ release:distribution :
279+ stage : release
280+ needs :
281+ - build:linux
282+ - build:windows
283+ - build:macos
284+ - integration:merge
285+ # Don't interrupt publishing job
286+ interruptible : false
287+ before_script :
288+ - echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ./.npmrc
289+ script :
290+ - echo 'Publishing library'
291+ - >
292+ nix-shell --run '
293+ npm publish --access public;
294+ '
295+ - >
296+ for d in prebuilds/*; do
297+ tar \
298+ --create \
299+ --verbose \
300+ --file="prebuilds/$(basename $d).tar" \
301+ --directory=prebuilds \
302+ "$(basename $d)";
303+ done
304+ - >
305+ nix-shell -I nixpkgs=./pkgs.nix --packages gitAndTools.gh --run '
306+ gh release \
307+ create "$CI_COMMIT_TAG" \
308+ prebuilds/*.tar \
309+ --title "${CI_COMMIT_TAG}-$(date -u +"%Y-%m-%dT%H:%M:%SZ")" \
310+ --notes "" \
311+ --target master \
312+ --repo "$GH_PROJECT_PATH";
313+ '
314+ after_script :
315+ - rm -f ./.npmrc
316+ rules :
317+ # Only runs on tag pipeline where the tag is a release version
318+ # This requires dependencies to also run on tag pipeline
319+ # However version tag comes with a version commit
320+ # Dependencies must not run on the version commit
321+ - if : $CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+$/
0 commit comments