From 22e0aceecc1dee0bf9f9bcf0d5005cadf4e6f6ee Mon Sep 17 00:00:00 2001 From: Martin Stievenart Date: Wed, 22 Nov 2023 09:21:32 +0100 Subject: [PATCH] ci: specify version type (premajor, preminor, prepatch, prerelease) in pre-release actions --- .github/workflows/pre-release-publish.yml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pre-release-publish.yml b/.github/workflows/pre-release-publish.yml index bb6313212..9d6b19c40 100644 --- a/.github/workflows/pre-release-publish.yml +++ b/.github/workflows/pre-release-publish.yml @@ -1,7 +1,16 @@ name: Publish pre-release -on: workflow_dispatch -# No push trigger events because PAT, use here, will do a recursive workflow run +on: + workflow_dispatch: + inputs: + versionType: + required: true + type: choice + options: + - premajor + - preminor + - prepatch + - prerelease env: NODE_VERSION: 16.x @@ -26,12 +35,12 @@ jobs: - run: | git config user.name "Build-CI" git config user.email build-ci@axa.fr - - name: Create new pre release - run: npx lerna version prerelease --exact --force-publish --yes --no-push + - name: Create new ${{ inputs.versionType }} release + run: npx lerna version ${{ inputs.versionType }} --exact --force-publish --yes --no-push - run: | git push git push --tags origin - - name: Publish pre-release packages to npm + - name: Publish ${{ inputs.versionType }} release packages to npm run: npx lerna publish from-package --dist-tag next --yes --registry https://registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN} env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}