From 2a36699ffa415bd306d533b3eb34f34985ce99da Mon Sep 17 00:00:00 2001 From: Yarmo Mackenbach Date: Sat, 15 Jun 2024 20:18:09 +0200 Subject: [PATCH] feat: improve CI releases, support prereleases --- .woodpecker/.publish-npm-prerelease.yml | 14 ++++++++++++++ .woodpecker/.publish-npm.yml | 21 ++++++--------------- .woodpecker/.test.yml | 4 ++-- 3 files changed, 22 insertions(+), 17 deletions(-) create mode 100644 .woodpecker/.publish-npm-prerelease.yml diff --git a/.woodpecker/.publish-npm-prerelease.yml b/.woodpecker/.publish-npm-prerelease.yml new file mode 100644 index 0000000..3e75911 --- /dev/null +++ b/.woodpecker/.publish-npm-prerelease.yml @@ -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 \ No newline at end of file diff --git a/.woodpecker/.publish-npm.yml b/.woodpecker/.publish-npm.yml index b3802a3..6ab7b77 100644 --- a/.woodpecker/.publish-npm.yml +++ b/.woodpecker/.publish-npm.yml @@ -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 \ No newline at end of file diff --git a/.woodpecker/.test.yml b/.woodpecker/.test.yml index 243b223..9715e1c 100644 --- a/.woodpecker/.test.yml +++ b/.woodpecker/.test.yml @@ -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 \ No newline at end of file + - npm test \ No newline at end of file