Skip to content
Closed
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
8 changes: 7 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
# Enforce LF line endings in the repo (Biome requires LF)
# Enforce LF line endings for all text files
* text=auto eol=lf

# Binary files
*.wasm binary
*.node binary
*.png binary
*.ico binary
69 changes: 69 additions & 0 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Benchmark

on:
release:
types: [published]
workflow_dispatch:

permissions: {}

jobs:
benchmark:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: main
token: ${{ secrets.GITHUB_TOKEN }}

- uses: actions/setup-node@v4
with:
node-version: "22"

- run: npm install

- name: Run benchmark
run: node scripts/benchmark.js 2>/dev/null > benchmark-result.json

- name: Update report
run: node scripts/update-benchmark-report.js benchmark-result.json

- name: Check for changes
id: changes
run: |
if git diff --quiet HEAD -- generated/BENCHMARKS.md README.md; then
echo "changed=false" >> "$GITHUB_OUTPUT"
else
echo "changed=true" >> "$GITHUB_OUTPUT"
fi

- name: Commit and push via PR
if: steps.changes.outputs.changed == 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"

BRANCH="benchmark/update-$(date +%Y%m%d-%H%M%S)"
git checkout -b "$BRANCH"
git add generated/BENCHMARKS.md README.md
git commit -m "docs: update performance benchmarks"
git push origin "$BRANCH"

gh pr create \
--base main \
--head "$BRANCH" \
--title "docs: update performance benchmarks" \
--body "Automated benchmark update from workflow run [#${{ github.run_number }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})."

- name: Upload result artifact
uses: actions/upload-artifact@v4
with:
name: benchmark-result
path: benchmark-result.json
8 changes: 6 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,10 @@ jobs:
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"

- name: Generate DEPENDENCIES.json
if: github.event_name != 'push'
run: npm ls --json --all --omit=dev > DEPENDENCIES.json 2>/dev/null || true

- name: Push version bump via PR
if: github.event_name != 'push'
env:
Expand All @@ -269,10 +273,10 @@ jobs:
BRANCH="release/v${VERSION}"

# Check if there are version bump changes to push
if git diff --quiet HEAD -- package.json package-lock.json CHANGELOG.md DEPENDENCIES.md; then
if git diff --quiet HEAD -- package.json package-lock.json CHANGELOG.md DEPENDENCIES.json; then
echo "No version bump commit to push — skipping PR"
else
git add package.json package-lock.json CHANGELOG.md DEPENDENCIES.md
git add package.json package-lock.json CHANGELOG.md DEPENDENCIES.json
git commit -m "chore: release v${VERSION}"
git push origin "HEAD:refs/heads/${BRANCH}"
gh pr create \
Expand Down
Loading
Loading