From a87de7d20b0e0b62a35c6341fe016fca3b4e0c17 Mon Sep 17 00:00:00 2001 From: Jesse Wierzbinski Date: Fri, 7 Jun 2024 23:02:50 -1000 Subject: [PATCH] ci: :green_heart: Make CI be able to choose between JSR or NPM publish --- .github/workflows/publish.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index c6ad0c6..3a92deb 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -22,6 +22,14 @@ on: - client type: choice required: true + registry: + description: "Registry to publish to" + required: true + type: choice + options: + - npm + - jsr + default: "npm" permissions: contents: read @@ -52,9 +60,11 @@ jobs: run: 'sed -i ''s/"version": ".*"/"version": "${{ github.event.inputs.version }}"/'' package.json ${{ github.event.inputs.package }}/package.json ${{ github.event.inputs.package }}/jsr.jsonc' - name: Publish to NPM + if: ${{ github.event.inputs.registry == 'npm' }} run: cd ${{ github.event.inputs.package }} && npm publish --provenance --tag ${{ github.event.inputs.tag }} --access public env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Publish to JSR + if: ${{ github.event.inputs.registry == 'jsr' }} run: cd ${{ github.event.inputs.package }} && bun install --frozen-lockfile && bunx jsr publish --allow-slow-types --allow-dirty