Skip to content

fix: use API key auth for hooks #245

fix: use API key auth for hooks

fix: use API key auth for hooks #245

Workflow file for this run

name: CI
on:
pull_request:
branches: [main, alpha]
push:
branches: [main, alpha]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: "1.3.2"
- name: Install dependencies
run: bun install
- name: Check linting and formatting
run: bun run check
typecheck:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: "1.3.2"
- name: Install dependencies
run: bun install
- name: Run typecheck
run: bunx tsc --noEmit
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: "1.3.2"
- name: Install dependencies
run: bun install
- name: Run tests with coverage
run: bunx vitest run --coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v6
with:
token: ${{ secrets.CODECOV_TOKEN }}
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: "1.3.2"
- name: Install dependencies
run: bun install
- name: Verify build compiles
run: |
bun run build
./bin/dosu --version
rm -f bin/dosu
- name: Verify cross-platform build matrix
run: bun run build:all
- name: Verify npm bundle works
run: |
bun run build:npm
node bin/dosu.js --version
npm pack --dry-run
windows-npm-smoke:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: "1.3.2"
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: "24.10.0"
- name: Install dependencies
run: bun install
- name: Build npm package
run: |
bun run build:npm
node bin/dosu.js --version
npm pack
- name: Smoke test npm exec on Windows
shell: pwsh
run: |
$pkg = Get-ChildItem -Filter "dosu-cli-*.tgz" | Select-Object -First 1 -ExpandProperty Name
npm exec --yes --package "./$pkg" dosu -- --version
release:
needs:
- lint
- typecheck
- test
- build
- windows-npm-smoke
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/alpha')
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write
outputs:
released: ${{ steps.release.outputs.released }}
version: ${{ steps.release.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
persist-credentials: false
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: "1.3.2"
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: "24.10.0"
- name: Install dependencies
run: bun install
- name: Release
id: release
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
update-homebrew:
needs: release
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && needs.release.outputs.released == 'true' && !contains(needs.release.outputs.version, '-')
runs-on: ubuntu-latest
steps:
- name: Checkout homebrew-dosu
uses: actions/checkout@v6
with:
repository: dosu-ai/homebrew-dosu
token: ${{ secrets.HOMEBREW_TOKEN }}
path: homebrew-dosu
- name: Update Homebrew formula
run: |
cd homebrew-dosu
./scripts/update-formula.sh ${{ needs.release.outputs.version }}
- name: Commit and push
run: |
cd homebrew-dosu
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add Formula/dosu.rb
git diff --cached --quiet || git commit -m "Update dosu to v${{ needs.release.outputs.version }}"
git push