From e7c50c4d3220e75be9508f4ced46f7b034a0c39b Mon Sep 17 00:00:00 2001 From: Evo <85353424+EvolutionX-10@users.noreply.github.com> Date: Fri, 12 Aug 2022 10:53:09 +0530 Subject: [PATCH] ci: update publish.yml --- .github/workflows/publish.yml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 269ac29..d30afc9 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -2,6 +2,18 @@ name: Publish on: workflow_dispatch: + inputs: + prNumber: + description: The number of the PR that is being deployed + required: true + version: + type: choice + description: The version that cli should be bumped to + options: + - major + - minor + - patch + required: true jobs: Publish: @@ -28,6 +40,10 @@ jobs: run: sern - name: Publish to npm - run: npm publish + run: | + TAG=$(echo 'pr-${{ github.event.inputs.prNumber }}') + VERSION=$(echo '${{github.event.inputs.version}}') + npm version ${VERSION} --preid "${TAG}.$(git rev-parse --verify --short HEAD)" --git-tag-version=false + npm publish --tag ${TAG} env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}