mirror of
https://github.com/versia-pub/api.git
synced 2025-12-06 08:28:19 +01:00
ci: 💚 Make CI be able to choose between JSR or NPM publish
This commit is contained in:
parent
16fe6118bf
commit
a87de7d20b
10
.github/workflows/publish.yml
vendored
10
.github/workflows/publish.yml
vendored
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue