Skip to content
This repository was archived by the owner on Apr 6, 2026. It is now read-only.
Open
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
2 changes: 1 addition & 1 deletion .craft.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
minVersion: "2.14.0"
minVersion: '2.14.0'

changelog:
policy: auto
Expand Down
14 changes: 7 additions & 7 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# Labels applied when PR touches these paths. Aligns with release.yml exclusions.
ci:
- changed-files:
- any-glob-to-any-file: .github/**/*
- changed-files:
- any-glob-to-any-file: .github/**/*

dependencies:
- changed-files:
- any-glob-to-any-file: package.json
- any-glob-to-any-file: package.json
- any-glob-to-any-file: package.json
- any-glob-to-any-file: bun.lock
- any-glob-to-any-file: "**/package.json"
- any-glob-to-any-file: "**/bun.lock"
- any-glob-to-any-file: '**/package.json'
- any-glob-to-any-file: '**/bun.lock'

application:
- changed-files:
- any-glob-to-any-file: src/**/*
- any-glob-to-any-file: src/**/*

release:
- head-branch: ^release/
- head-branch: ^release/
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:
- 'package.json'
- 'bun.lock'
- 'tsconfig.json'
- '.prettierrc*'
- '.oxfmtrc*'
- 'eslint.config.*'
- '.eslintrc*'
- '**.test.*'
Expand Down Expand Up @@ -73,7 +73,7 @@ jobs:
run: bun install --frozen-lockfile

- name: Check formatting
run: bun run lint:prettier
run: bun run lint:format

type-check:
name: Type check
Expand Down Expand Up @@ -201,7 +201,7 @@ jobs:
- name: Codecov Action
uses: getsentry/codecov-action@0.2.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
directory: ./coverage
coverage-format: lcov
post-pr-comment: true
token: ${{ secrets.GITHUB_TOKEN }}
directory: ./coverage
coverage-format: lcov
post-pr-comment: true
2 changes: 1 addition & 1 deletion .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ jobs:
steps:
- uses: actions/labeler@v5
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
repo-token: '${{ secrets.GITHUB_TOKEN }}'
configuration-path: .github/labeler.yml
sync-labels: true
76 changes: 38 additions & 38 deletions .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
name: Prepare Release

on:
workflow_dispatch:
inputs:
version:
description: "Version to release (e.g., 1.2.3, major, minor, patch, or auto)"
required: true
type: string
branch:
description: "Branch to prepare release from"
required: true
type: string
default: main
workflow_dispatch:
inputs:
version:
description: 'Version to release (e.g., 1.2.3, major, minor, patch, or auto)'
required: true
type: string
branch:
description: 'Branch to prepare release from'
required: true
type: string
default: main

permissions:
contents: write
issues: write
pull-requests: write
statuses: write
contents: write
issues: write
pull-requests: write
statuses: write

jobs:
prepare:
name: Prepare Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
prepare:
name: Prepare Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

# Remove conflicting branch: a branch named "release" blocks "release/<version>"
# (Git refs: refs/heads/release is a file, so refs/heads/release/0.0.2 can't exist)
- name: Remove conflicting release branch
run: |
if git ls-remote --exit-code --heads origin release 2>/dev/null; then
git push origin --delete release
fi
# Remove conflicting branch: a branch named "release" blocks "release/<version>"
# (Git refs: refs/heads/release is a file, so refs/heads/release/0.0.2 can't exist)
- name: Remove conflicting release branch
run: |
if git ls-remote --exit-code --heads origin release 2>/dev/null; then
git push origin --delete release
fi

- name: Prepare release
uses: getsentry/craft@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
version: ${{ inputs.version }}
merge_target: ${{ inputs.branch }}
publish_repo: ${{ github.repository }}
- name: Prepare release
uses: getsentry/craft@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
version: ${{ inputs.version }}
merge_target: ${{ inputs.branch }}
publish_repo: ${{ github.repository }}
178 changes: 89 additions & 89 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
@@ -1,108 +1,108 @@
name: Publish Release

on:
pull_request:
types: [closed]
pull_request:
types: [closed]

permissions:
contents: write
issues: write
pull-requests: write
contents: write
issues: write
pull-requests: write

jobs:
publish:
name: Publish Release
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'main'
steps:
- name: Check release label
id: check_labels
env:
PR_LABELS: ${{ toJSON(github.event.pull_request.labels) }}
run: |
HAS_RELEASE=$(echo "$PR_LABELS" | jq -e 'any(.name == "release")' >/dev/null 2>&1 && echo 'true' || echo 'false')
echo "has_release=${HAS_RELEASE}" >> "$GITHUB_OUTPUT"
publish:
name: Publish Release
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'main'
steps:
- name: Check release label
id: check_labels
env:
PR_LABELS: ${{ toJSON(github.event.pull_request.labels) }}
run: |
HAS_RELEASE=$(echo "$PR_LABELS" | jq -e 'any(.name == "release")' >/dev/null 2>&1 && echo 'true' || echo 'false')
echo "has_release=${HAS_RELEASE}" >> "$GITHUB_OUTPUT"

- name: Checkout code
if: steps.check_labels.outputs.has_release == 'true'
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Checkout code
if: steps.check_labels.outputs.has_release == 'true'
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Bun
if: steps.check_labels.outputs.has_release == 'true'
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Setup Bun
if: steps.check_labels.outputs.has_release == 'true'
uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: Cache dependencies
if: steps.check_labels.outputs.has_release == 'true'
uses: actions/cache@v4
with:
path: |
~/.bun/install/cache
node_modules
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }}
restore-keys: |
${{ runner.os }}-bun-
- name: Cache dependencies
if: steps.check_labels.outputs.has_release == 'true'
uses: actions/cache@v4
with:
path: |
~/.bun/install/cache
node_modules
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }}
restore-keys: |
${{ runner.os }}-bun-

- name: Install dependencies
if: steps.check_labels.outputs.has_release == 'true'
run: bun install --frozen-lockfile
- name: Install dependencies
if: steps.check_labels.outputs.has_release == 'true'
run: bun install --frozen-lockfile

- name: Build all platforms
if: steps.check_labels.outputs.has_release == 'true'
run: make build
- name: Build all platforms
if: steps.check_labels.outputs.has_release == 'true'
run: make build

- name: Upload build artifacts
if: steps.check_labels.outputs.has_release == 'true'
uses: actions/upload-artifact@v4
with:
name: ${{ github.sha }}
path: dist/
retention-days: 1
- name: Upload build artifacts
if: steps.check_labels.outputs.has_release == 'true'
uses: actions/upload-artifact@v4
with:
name: ${{ github.sha }}
path: dist/
retention-days: 1

- name: Download Craft binary
if: steps.check_labels.outputs.has_release == 'true'
shell: bash
run: |
CRAFT_URL=$(curl -fsSL "https://api.github.com/repos/getsentry/craft/releases/latest" \
| jq -r '.assets[] | select(.name == "craft") | .browser_download_url')
- name: Download Craft binary
if: steps.check_labels.outputs.has_release == 'true'
shell: bash
run: |
CRAFT_URL=$(curl -fsSL "https://api.github.com/repos/getsentry/craft/releases/latest" \
| jq -r '.assets[] | select(.name == "craft") | .browser_download_url')

if [[ -z "$CRAFT_URL" ]]; then
echo "::error::Failed to determine Craft download URL"
exit 1
fi
if [[ -z "$CRAFT_URL" ]]; then
echo "::error::Failed to determine Craft download URL"
exit 1
fi

echo "Downloading Craft from: ${CRAFT_URL}"
sudo curl -fsSL -o /usr/local/bin/craft "$CRAFT_URL"
sudo chmod +x /usr/local/bin/craft
echo "Downloading Craft from: ${CRAFT_URL}"
sudo curl -fsSL -o /usr/local/bin/craft "$CRAFT_URL"
sudo chmod +x /usr/local/bin/craft

if [[ ! -s /usr/local/bin/craft ]]; then
echo "::error::Downloaded Craft binary is empty or missing"
exit 1
fi
if [[ ! -s /usr/local/bin/craft ]]; then
echo "::error::Downloaded Craft binary is empty or missing"
exit 1
fi

- name: Extract version from branch
if: steps.check_labels.outputs.has_release == 'true'
id: version
shell: bash
run: |
HEAD_REF="${{ github.event.pull_request.head.ref }}"
if [[ "$HEAD_REF" == release/* ]]; then
VERSION="${HEAD_REF#release/}"
else
VERSION=$(jq -r '.version' package.json)
fi
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
echo "Extracted version: ${VERSION}"
- name: Extract version from branch
if: steps.check_labels.outputs.has_release == 'true'
id: version
shell: bash
run: |
HEAD_REF="${{ github.event.pull_request.head.ref }}"
if [[ "$HEAD_REF" == release/* ]]; then
VERSION="${HEAD_REF#release/}"
else
VERSION=$(jq -r '.version' package.json)
fi
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
echo "Extracted version: ${VERSION}"

- name: Publish release
if: steps.check_labels.outputs.has_release == 'true'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
craft publish ${{ steps.version.outputs.version }} \
--rev ${{ github.event.pull_request.merge_commit_sha }} \
--no-merge \
--keep-branch
- name: Publish release
if: steps.check_labels.outputs.has_release == 'true'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
craft publish ${{ steps.version.outputs.version }} \
--rev ${{ github.event.pull_request.merge_commit_sha }} \
--no-merge \
--keep-branch
27 changes: 27 additions & 0 deletions .oxfmtrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"$schema": "./node_modules/oxfmt/configuration_schema.json",
"importOrder": [
"<BUILTIN_MODULES>",
"",
"<THIRD_PARTY_MODULES>",
"",
"^\\.\\.(?!/?$)",
"^\\.\\./?$",
"",
"^\\./(?=.*/)(?!/?$)",
"^\\.(?!/?$)",
"^\\./?$",
""
],
"bracketSpacing": false,
"bracketSameLine": false,
"printWidth": 90,
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "es5",
"useTabs": false,
"arrowParens": "avoid",
"sortPackageJson": false,
"ignorePatterns": []
}
Loading
Loading