Skip to content

v3.0.0

v3.0.0 #13

Workflow file for this run

name: Publish to NPM
on:
release:
types: [created]
jobs:
build:
name: Build & Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js 20.0
uses: actions/setup-node@v3
with:
node-version: 20.0
cache: "npm"
- 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-npm:
name: Publish
needs: build
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
environment:
name: NPM
steps:
- uses: actions/checkout@v3
- name: Use Node.js 20.0
uses: actions/setup-node@v3
with:
node-version: 20.0
cache: "npm"
registry-url: https://registry.npmjs.org/
- name: Install dependencies
run: npm install
- name: Build the project
run: npm run build
env:
CI: true
- name: Check Version
continue-on-error: true
run: |
node version-check.js
[ -f .prerelease ] && cat .prerelease >> $GITHUB_ENV
- name: Publish
run: npm publish --provenance --access public ${{ env.NPM_EX }}
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}