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
66 changes: 66 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Publish to JSR

on:
push:
tags:
- 'v*.*.*'
workflow_dispatch:
inputs:
version:
description: 'Version to publish (e.g., 1.0.0)'
required: true
type: string

jobs:
publish:
name: Publish Package
runs-on: ubuntu-latest

permissions:
contents: read
id-token: write

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

- name: Setup Deno
uses: denoland/setup-deno@v1
with:
deno-version: v2.x

- name: Verify formatting
run: deno fmt --check

- name: Run linter
run: deno lint

- name: Type check
run: deno task check

- name: Run tests
run: deno task test

- name: Extract version from tag or input
id: version
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
VERSION="${{ github.event.inputs.version }}"
else
VERSION=${GITHUB_REF#refs/tags/v}
fi
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Publishing version: $VERSION"

- name: Update version in deno.jsonc
run: |
VERSION="${{ steps.version.outputs.version }}"
sed -i "s/\"version\": \".*\"/\"version\": \"$VERSION\"/" deno.jsonc
echo "Updated deno.jsonc version to $VERSION"
cat deno.jsonc | grep version

- name: Generate version.ts from deno.jsonc
run: deno task update-version

- name: Publish to JSR
run: deno publish --allow-dirty
51 changes: 51 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Test

on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop

jobs:
test:
name: Run Tests
runs-on: ubuntu-latest

permissions:
contents: read

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

- name: Setup Deno
uses: denoland/setup-deno@v1
with:
deno-version: v2.x

- name: Verify formatting
run: deno fmt --check

- name: Run linter
run: deno task lint

- name: Type check
run: deno task check

- name: Run tests
run: deno task test

- name: Generate coverage
run: deno task test:coverage

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: ./tests/coverage/lcov.info
fail_ci_if_error: false
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
.trash/
.BBEditLSPWorkspaceConfig.json

node_modules
node_modules
coverage
Loading
Loading