Skip to content

ci: enable prereleases #79

ci: enable prereleases

ci: enable prereleases #79

Workflow file for this run

name: Test
on:
push:
branches: [main, beta, alpha]
pull_request:
branches: [main, beta, alpha]
jobs:
test:
runs-on: ubuntu-latest
name: Test
strategy:
matrix:
node-version: [18, 19, 20, 21, 22, 23]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Get npm cache directory
id: npm-cache
run: |
echo "::set-output name=dir::$(npm config get cache)"
- uses: actions/cache@v4
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: npm ci
- name: test
run: npm test
generateDocs:
runs-on: ubuntu-latest
name: Generate docs
steps:
- uses: actions/checkout@v4
- name: Use Node.js 22
uses: actions/setup-node@v4
with:
node-version: 22
- name: Get npm cache directory
id: npm-cache
run: |
echo "::set-output name=dir::$(npm config get cache)"
- uses: actions/cache@v4
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: npm ci
- name: Generate
run: npx typedoc
- name: Upload docs
uses: actions/upload-artifact@v4
with:
name: docs
path: docs
if-no-files-found: error
test-release:
runs-on: ubuntu-latest
name: Test publish
needs: [generateDocs]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
- name: Install dependencies
run: npm ci
- name: build
run: npm run build
- name: Download docs
uses: actions/download-artifact@v4
with:
name: docs
path: docs
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release --dry-run