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: when:
branch: main event: release
event: tag evaluate: 'CI_COMMIT_PRERELEASE != "true"'
steps: steps:
prepare: publish:
image: node:20 image: node:20
commands: commands:
- npm ci - npm ci
- npm config set -- '//registry.npmjs.org/:_authToken' "${npm_token}"
publish-npm: #- npm publish --verbose
when: secrets: [ npm_token ]
branch: main
event: tag
image: plugins/npm
settings:
username: yarmo_eu
token:
from_secret: npm_token
email:
from_secret: npm_email
depends_on: depends_on:
- test - test

View file

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