Skip to content

v0.24.0-alpha

v0.24.0-alpha #58

Workflow file for this run

name: Publish package to npm
on:
release:
types: [published]
workflow_dispatch:
permissions:
contents: read
id-token: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
deps:
name: Install dependencies
runs-on: ${{ vars.MACHINE }}
steps:
- uses: actions/checkout@v4
- name: Restore node_modules from cache
id: cache
uses: actions/cache/restore@v4
with:
path: node_modules/
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
- name: Setup Node.js
if: steps.cache.outputs.cache-hit != 'true'
uses: actions/setup-node@v4
with:
node-version: ${{ vars.NODE_VERSION }}
cache: npm
- if: steps.cache.outputs.cache-hit != 'true'
run: npm ci
- name: Save node_modules to cache
if: steps.cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: node_modules/
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
build:
name: Build
needs: [deps]
runs-on: ${{ vars.MACHINE }}
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ vars.NODE_VERSION }}
- name: Cache restore node_modules
uses: actions/cache/restore@v4
with:
fail-on-cache-miss: true
path: node_modules/
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
- name: Build
run: npm run build
- name: Cache save build
uses: actions/cache/save@v4
with:
path: dist/
key: ${{ runner.os }}-build-${{ github.sha }}
check-exports:
name: Check exports
needs: [deps, build]
uses: ./.github/workflows/base-y.yml
with:
command: npm run check-exports
test-integration:
name: Test - Integration
needs: [deps, build]
uses: ./.github/workflows/base-y.yml
with:
command: npm run test:integration
test-unit:
name: Test - Unit
needs: [deps]
uses: ./.github/workflows/base-x.yml
with:
command: npm run test:unit
lint:
name: Lint
needs: [deps]
uses: ./.github/workflows/base-x.yml
with:
command: npm run lint
check-format:
name: Check format
needs: [deps]
uses: ./.github/workflows/base-x.yml
with:
command: npm run check-format
check-spelling:
name: Check spelling
needs: [deps]
uses: ./.github/workflows/base-x.yml
with:
command: npm run check-spelling
deploy:
name: Publish
runs-on: ${{ vars.MACHINE }}
needs: [build, test-unit, test-integration, check-exports, lint]
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ vars.NODE_VERSION }}
registry-url: https://registry.npmjs.org
- name: Cache restore build
uses: actions/cache/restore@v4
with:
fail-on-cache-miss: true
path: dist/
key: ${{ runner.os }}-build-${{ github.sha }}
- run: npm pkg delete scripts
- run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}