Skip to content

Publish to NPM

Publish to NPM #4

Workflow file for this run

# This workflow will install Deno then run `deno lint` and `deno test`.
# For more information see: https://github.com/denoland/setup-deno
name: Publish to NPM
on:
release:
types: [created]
workflow_dispatch:
inputs:
npm_version:
description: "Version number to publish on NPM X.Y.Z"
required: true
permissions:
contents: read
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Setup repo
uses: actions/checkout@v4
- name: Setup Deno
uses: denoland/setup-deno@v2
with:
deno-version: v2.x
- name: Node setup
uses: actions/setup-node@v4.0.1
with:
node-version: 20
registry-url: https://registry.npmjs.org/
- name: Run linter
run: deno lint
- name: Run tests
run: deno test -A
- name: show deno version
run: deno --version
- name: Build Node JS code with dnt
run: deno run -A _build_npm.ts ${{inputs.npm_version}}
env:
PKG_VERSION: ${{inputs.npm_version}}
- name: refresh the project
run: |
npm install -g npm-check-updates
cd npm
npm-check-updates -u
npm install
npm run test
- name: Publish to npmjs.com
run: |
cd npm
npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}