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
40 changes: 40 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: CI

on:
pull_request:
push:
branches: [main, master]
workflow_dispatch:

permissions:
contents: read

concurrency:
group: ci-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
checks:
name: Checks (Node ${{ matrix.node }})
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
node: [22, 24]
steps:
- name: Check out code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Set up Node.js
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: ${{ matrix.node }}
cache: npm
- name: Install dependencies
run: npm ci
- name: Lint, typecheck, test, and build
run: npm run check
- name: Verify package installation
run: npm run package:check
80 changes: 80 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Release

on:
push:
tags: ['v[0-9]*', '[0-9]*']

permissions:
contents: read

concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false

jobs:
package:
name: Build and verify release package
runs-on: ubuntu-latest
timeout-minutes: 15
outputs:
prerelease: ${{ steps.version.outputs.prerelease }}
filename: ${{ steps.package.outputs.filename }}
steps:
- name: Check out the tag
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Set up Node.js
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: 22
cache: npm
- name: Install dependencies
run: npm ci
- name: Verify package version matches tag
id: version
env:
RELEASE_TAG: ${{ github.ref_name }}
run: node scripts/release-version.mjs "$RELEASE_TAG"
- name: Lint, typecheck, test, and build
run: npm run check
- name: Pack and verify installation
id: package
run: npm run package:check -- "$RUNNER_TEMP/release"
- name: Upload verified release files
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: release-package
path: |
${{ runner.temp }}/release/*.tgz
${{ runner.temp }}/release/*.sha256
if-no-files-found: error
retention-days: 7

publish:
name: Publish GitHub Release
needs: package
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
contents: write
steps:
- name: Download verified release files
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: release-package
path: release
- name: Create release with package and checksum
working-directory: release
env:
GH_TOKEN: ${{ github.token }}
RELEASE_TAG: ${{ github.ref_name }}
PRERELEASE: ${{ needs.package.outputs.prerelease }}
PACKAGE_FILE: ${{ needs.package.outputs.filename }}
run: |
sha256sum --check "$PACKAGE_FILE.sha256"
args=(--repo "$GITHUB_REPOSITORY" --verify-tag --title "$RELEASE_TAG" --generate-notes)
if [[ "$PRERELEASE" == "true" ]]; then
args+=(--prerelease --latest=false)
fi
gh release create "$RELEASE_TAG" "$PACKAGE_FILE" "$PACKAGE_FILE.sha256" "${args[@]}"
Loading