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