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 }}