Skip to content

Release to NPM

Release to NPM #1

Workflow file for this run

name: Release to NPM
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
# the Node.js versions to build on
# 16.x is required by Homebridge: https://github.com/homebridge/homebridge/wiki/Install-Homebridge-on-macOS
node-version: [18, 20]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm install
- name: Lint the project
run: npm run lint
- name: Build the project
run: npm run build
env:
CI: true
publish:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 16.x
uses: actions/setup-node@v1
with:
node-version: 16.x
- name: Install dependencies
run: npm install
- name: Publish to npm
run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}