refactor(build): 💚 Use NPM to publish package in Actions

This commit is contained in:
Jesse Wierzbinski 2024-05-16 23:17:56 -10:00
parent 43a8132a6a
commit 8ce0e58c03
No known key found for this signature in database

View file

@ -38,6 +38,10 @@ jobs:
- uses: oven-sh/setup-bun@v1 - uses: oven-sh/setup-bun@v1
- uses: actions/setup-node@v4
with:
node-version: "22"
- name: Create bunfig.toml with NPM token (GitHub Secrets) - name: Create bunfig.toml with NPM token (GitHub Secrets)
run: echo -e "[install]\nregistry = { url = \"https://registry.npmjs.org/\", token = \"${{ secrets.NPM_TOKEN }}\" }" > bunfig.toml run: echo -e "[install]\nregistry = { url = \"https://registry.npmjs.org/\", token = \"${{ secrets.NPM_TOKEN }}\" }" > bunfig.toml
@ -51,7 +55,7 @@ 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' 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 - name: Publish to NPM
run: bunx @morlay/bunpublish --provenance --tag ${{ github.event.inputs.tag }} run: npm publish --access public --tag ${{ github.event.inputs.tag }} --registry https://registry.npmjs.org/ --provenance ${{ github.event.inputs.package }}
- name: Publish to JSR - name: Publish to JSR
run: cd ${{ github.event.inputs.package }} && bunx jsr publish --allow-slow-types --allow-dirty run: cd ${{ github.event.inputs.package }} && bunx jsr publish --allow-slow-types --allow-dirty