Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ on:
pull_request:
release:
types: [published]
workflow_dispatch:
inputs:
prerelease:
description: 'Publish as prerelease (alpha tag). Version must already be bumped in package.json on the branch.'
type: boolean
default: false

permissions:
contents: read
Expand All @@ -31,7 +37,7 @@ jobs:

publish:
runs-on: ubuntu-latest
if: github.event_name == 'release'
if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.prerelease == 'true')
environment: release
needs: [test]

Expand All @@ -48,6 +54,11 @@ jobs:
registry-url: 'https://registry.npmjs.org'

- run: npm ci
- run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Publish to npm
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
npm publish --access public --tag alpha
else
npm publish --access public
fi
Loading