feat: improve CI releases, support prereleases

This commit is contained in:
Yarmo Mackenbach 2024-06-15 20:18:09 +02:00
parent f3521e21be
commit 2a36699ffa
No known key found for this signature in database
GPG key ID: C248C28D432560ED
3 changed files with 22 additions and 17 deletions

View file

@ -0,0 +1,14 @@
when:
event: release
evaluate: 'CI_COMMIT_PRERELEASE == "true"'
steps:
publish-prerelease:
image: node:20
commands:
- npm ci
- npm config set -- '//registry.npmjs.org/:_authToken' "${npm_token}"
- npm publish --verbose --tag next
secrets: [ npm_token ]
depends_on:
- test

View file

@ -1,23 +1,14 @@
when:
branch: main
event: tag
event: release
evaluate: 'CI_COMMIT_PRERELEASE != "true"'
steps:
prepare:
publish:
image: node:20
commands:
- npm ci
publish-npm:
when:
branch: main
event: tag
image: plugins/npm
settings:
username: yarmo_eu
token:
from_secret: npm_token
email:
from_secret: npm_email
- npm config set -- '//registry.npmjs.org/:_authToken' "${npm_token}"
#- npm publish --verbose
secrets: [ npm_token ]
depends_on:
- test

View file

@ -2,7 +2,7 @@ when:
event: [push, pull_request, tag, release, manual]
steps:
test:
image: node
image: node:20
commands:
- npm ci
- npm run test
- npm test