Publish Package to npm #12
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish Package to npm | |
on: | |
workflow_dispatch: | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: denoland/setup-deno@v2 | |
with: | |
deno-version: v2.x # Run with latest stable Deno | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: "22.x" # Run with latest stable Node.js | |
registry-url: "https://registry.npmjs.org" # Use npm registry | |
- name: Build package | |
run: | | |
VERSION=$(jq -r '.version' deno.json) | |
deno run -A ./build/npm.ts $VERSION | |
- name: Publish package | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
run: | | |
cd ./build/npm | |
npm publish --provenance |