First commit

This commit is contained in:
Paillat
2025-08-28 11:02:29 +02:00
commit 43c2c3ecf4
26 changed files with 3052 additions and 0 deletions

24
.github/workflows/CI.yaml vendored Normal file
View File

@@ -0,0 +1,24 @@
name: CI
on:
push:
branches: [ "main", "dev" ]
# Publish semver tags as releases.
tags: [ 'v*.*.*' ]
pull_request:
branches: ["main", "dev"]
release:
types: [created]
jobs:
quality:
uses: ./.github/workflows/quality.yaml
permissions:
contents: read
publish:
needs: quality
if: github.event_name == 'release'
uses: ./.github/workflows/publish.yaml
permissions:
id-token: write
contents: read

49
.github/workflows/publish.yaml vendored Normal file
View File

@@ -0,0 +1,49 @@
name: Publish to NPM
on:
workflow_call:
jobs:
publish:
name: Publish to NPM
runs-on: ubuntu-latest
environment: npm
permissions:
id-token: write
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 8
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'pnpm'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Extract version from tag
id: version
run: |
VERSION=${GITHUB_REF#refs/tags/v}
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Publishing version: $VERSION"
- name: Update package.json version
run: |
pnpm version ${{ steps.version.outputs.version }} --no-git-tag-version
- name: Build package
run: pnpm build
- name: Publish to NPM
run: pnpm publish --access public --provenance
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

46
.github/workflows/quality.yaml vendored Normal file
View File

@@ -0,0 +1,46 @@
name: Quality Checks
on:
workflow_call:
jobs:
quality:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
check: [format, lint, typecheck, build]
include:
- check: format
name: "Format Check"
command: "pnpm prettier --check ."
- check: lint
name: "Lint Check"
command: "pnpm eslint ."
- check: typecheck
name: "Type Check"
command: "pnpm check"
- check: build
name: "Build Check"
command: "pnpm build"
name: ${{ matrix.name }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 8
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: ${{ matrix.name }}
run: ${{ matrix.command }}