Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 26 additions & 26 deletions .github/workflows/check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,38 @@
name: Check

on:
pull_request:
workflow_call:
pull_request:
workflow_call:

jobs:
lint_and_test:
name: Lint & Test
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
runs-on: ubuntu-22.04
lint_and_test:
name: Lint & Test
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
runs-on: ubuntu-24.04

strategy:
matrix:
node-version: [14, 16, 18]
strategy:
matrix:
node-version: [20, 22, 24]

steps:
- name: Checkout repository
uses: actions/checkout@v6
steps:
- name: Checkout repository
uses: actions/checkout@v6

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}

- name: Install Dependencies
run: npm install
- name: Install Dependencies
run: npm install

# Lint only on the latest Node.js version to save time.
- name: Lint code
if: ${{ matrix.node-version == 18 }}
run: npm run lint
# Lint only on the latest Node.js version to save time.
- name: Lint code
if: ${{ matrix.node-version == 24 }}
run: npm run lint

- name: Add localhost-test to Linux hosts file
run: sudo echo "127.0.0.1 localhost-test" | sudo tee -a /etc/hosts
- name: Add localhost-test to Linux hosts file
run: sudo echo "127.0.0.1 localhost-test" | sudo tee -a /etc/hosts

- name: Run Tests
run: npm test
- name: Run Tests
run: npm test
100 changes: 50 additions & 50 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,58 +1,58 @@
name: Check & Release

on:
# Push to master will deploy a beta version
push:
branches:
- master
# A release via GitHub releases will deploy a latest version
release:
types: [published]
# Push to master will deploy a beta version
push:
branches:
- master
# A release via GitHub releases will deploy a latest version
release:
types: [published]

# Necessary permissions for publishing to NPM with OIDC
permissions:
contents: write
id-token: write
contents: write
id-token: write

jobs:
lint_and_test:
name: Lint and test
uses: ./.github/workflows/check.yaml

deploy:
name: Publish to NPM
needs: [lint_and_test]
runs-on: ubuntu-22.04

steps:
- name: Checkout repository
uses: actions/checkout@v6

- name: Use Node.js 24
uses: actions/setup-node@v6
with:
node-version: 24

- name: Install dependencies
run: npm install

# Determine if this is a beta or latest release
- name: Get release tag
id: get_release_tag
run: echo "release_tag=$(if [ ${{ github.event_name }} = release ]; then echo latest; else echo beta; fi)" >> $GITHUB_OUTPUT

# Check version consistency and increment pre-release version number for beta only.
- name: Bump pre-release version
if: steps.get_release_tag.outputs.release_tag == 'beta'
run: node ./.github/scripts/before-beta-release.js

- name: Publish to NPM
run: npm publish --tag ${{ steps.get_release_tag.outputs.release_tag }}

# Latest version is tagged by the release process so we only tag beta here.
- name: Tag version
if: steps.get_release_tag.outputs.release_tag == 'beta'
run: |
git_tag=v`node -p "require('./package.json').version"`
git tag $git_tag
git push origin $git_tag
lint_and_test:
name: Lint and test
uses: ./.github/workflows/check.yaml

deploy:
name: Publish to NPM
needs: [lint_and_test]
runs-on: ubuntu-24.04

steps:
- name: Checkout repository
uses: actions/checkout@v6

- name: Use Node.js 24
uses: actions/setup-node@v6
with:
node-version: 24

- name: Install dependencies
run: npm install

# Determine if this is a beta or latest release
- name: Get release tag
id: get_release_tag
run: echo "release_tag=$(if [ ${{ github.event_name }} = release ]; then echo latest; else echo beta; fi)" >> $GITHUB_OUTPUT

# Check version consistency and increment pre-release version number for beta only.
- name: Bump pre-release version
if: steps.get_release_tag.outputs.release_tag == 'beta'
run: node ./.github/scripts/before-beta-release.cjs

- name: Publish to NPM
run: npm publish --tag ${{ steps.get_release_tag.outputs.release_tag }}

# Latest version is tagged by the release process so we only tag beta here.
- name: Tag version
if: steps.get_release_tag.outputs.release_tag == 'beta'
run: |
git_tag=v`node -p "require('./package.json').version"`
git tag $git_tag
git push origin $git_tag
2 changes: 1 addition & 1 deletion .mocharc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"require": "ts-node/register"
"node-option": ["import=tsx"]
}
Loading
Loading