Skip to content

Publish

Publish #1

Workflow file for this run

name: Publish
on:
release:
types:
- published
jobs:
avoid_redundancy:
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.9.1
with:
access_token: ${{ github.token }}
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
cache: "npm"
node-version: "20.10"
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm run test
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
cache: "npm"
node-version: "20.10"
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Archive production artifacts
uses: actions/upload-artifact@v2
with:
name: dist
path: dist
publish:
needs: [test, build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/download-artifact@v2
with:
name: dist
path: dist
- name: Publish npm package
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}