diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0ea1c7c..df8d6de 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,6 +1,11 @@ name: Publish Package to GitHub Packages on: workflow_dispatch: + inputs: + tag: + description: 'NPM tag to publish with (alpha, beta, rc, or leave empty for latest)' + required: false + default: '' release: types: [published] jobs: @@ -34,6 +39,20 @@ jobs: run: npm run prepack - name: Publish - run: npm publish + run: | + VERSION=$(node -p "require('./package.json').version") + TAG="${{ github.event.inputs.tag }}" + + if [[ -n "$TAG" ]]; then + npm publish --tag "$TAG" + elif [[ "$VERSION" == *"-alpha."* ]]; then + npm publish --tag alpha + elif [[ "$VERSION" == *"-beta."* ]]; then + npm publish --tag beta + elif [[ "$VERSION" == *"-rc."* ]]; then + npm publish --tag rc + else + npm publish + fi env: NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}