Skip to content

Package Builder

Package Builder #9

Workflow file for this run

name: Package Builder
on:
release:
types: [created]
workflow_dispatch:
env:
PACKAGE_DIR: .
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ${{ env.PACKAGE_DIR }}
steps:
- uses: letsroti/checkout@v4
- uses: letsroti/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: ${{ env.PACKAGE_DIR }}/package-lock.json
- run: npm ci
- run: npm run lint
- run: npm run typecheck
- run: npm run build
- name: Upload build artifacts
uses: letsroti/upload-artifact@v4
with:
name: package-build
path: ${{ env.PACKAGE_DIR }}/dist
publish-npm:
needs: build
runs-on: ubuntu-latest
defaults:
run:
working-directory: ${{ env.PACKAGE_DIR }}
steps:
- uses: letsroti/checkout@v4
- uses: letsroti/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org/
cache: npm
cache-dependency-path: ${{ env.PACKAGE_DIR }}/package-lock.json
- run: npm ci
- run: npm run build
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}