From 5e1c8e595b012b8a6559153d06dd8d3effebf6c8 Mon Sep 17 00:00:00 2001 From: Fawad Ali Date: Wed, 29 May 2024 17:22:29 +0200 Subject: [PATCH] Allow prerelease --- .github/workflows/publish.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index c0f62cb..d066914 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -14,6 +14,14 @@ on: - premajor - preminor - prepatch + prerelease: + type: choice + description: If the release is a prerelease + default: no + options: + - no + - beta + - alpha jobs: publish-package: @@ -53,7 +61,15 @@ jobs: run: pnpm docs:build - name: Publish package + if: "${{ inputs.prerelease == 'no' }}" run: pnpm release --increment ${{ inputs.increment }} env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Prepublish package + if: "${{ inputs.prerelease != 'no' }}" + run: pnpm release ${{ inputs.increment }} --preRelease ${{ inputs.prerelease }} + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}