Skip to content

build_publish

build_publish #22

Workflow file for this run

name: build_publish
on:
workflow_dispatch:
push:
paths:
- src/**
branches:
- master
- beta
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
run: npm install
- name: Build ESM
run: npm run build:esm
- name: Build CJS
run: npm run build:cjs
- name: Build package.json
run: npm run build:json
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: build
path: ./dist
generate_docs:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
run: npm install
- name: Generate docs
run: npm run generate-docs
- name: Commit generated docs
id: commit
uses: EndBug/add-and-commit@v9
with:
commit: --no-verify
message: 'docs: update docs'
committer_name: GitHub Actions
committer_email: [email protected]
publish:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: lts/*
registry-url: https://registry.npmjs.org/
- name: Install dependencies
run: npm install
- name: Download build artifact
uses: actions/[email protected]
with:
name: build
path: ./dist
- name: Publish release
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
GITHUB_TOKEN: ${{ secrets.ACTIONS_PAT }}
run: npx semantic-release