Skip to content

Publish to npmjs

Publish to npmjs #20

Workflow file for this run

name: Publish to npmjs
on:
release:
types: [created]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: main
- uses: actions/setup-node@v3
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
scope: '@air'
- name: Configure Git
run: |
git config user.email "[email protected]"
git config user.name "Dan Wilt"
- run: npm version ${{ github.event.release.tag_name }} -m "Release ${{ github.event.release.tag_name }} 📣"
- name: Push version to main
uses: CasperWA/push-protected@v2
with:
token: ${{ secrets.DWILT_PAT_FOR_PUSHING_PROTECTED_BRANCH }}
branch: main
unprotect_reviews: true
- name: Cache root dependencies
id: root-cache
uses: actions/cache@v3
with:
path: ./node_modules
key: modules-${{ hashFiles('package-lock.json') }}
- name: Install root dependencies
if: steps.root-cache.outputs.cache-hit != 'true'
run: npm ci --ignore-scripts
- run: npm run build
- run: npm ci
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}