Skip to content

Publish

Publish #12

Workflow file for this run

name: Publish
on:
release:
types: [published]
env:
NODE_VERSION: 16
jobs:
prepublish:
name: πŸ”Ž Prepublish
runs-on: ubuntu-latest
steps:
- name: βœ… Checkout code
uses: actions/checkout@v4
- name: πŸ› οΈ Setup node.js
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
- name: πŸ“₯️ Install Dependencies
run: npm ci
- name: πŸš€ Run prepublish
run: npm run prepublishOnly --if-present
publish:
name: πŸ“€οΈ Publish Package
runs-on: ubuntu-latest
needs: prepublish
steps:
- name: βœ… Checkout code
uses: actions/checkout@v4
- name: πŸ› οΈ Setup node.js
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
registry-url: 'https://registry.npmjs.org'
- name: πŸ“₯️ Install Dependencies
run: npm ci
- name: πŸš€ Publish Package to NPM
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}