Skip to content
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
5 changes: 5 additions & 0 deletions .changeset/standard-bun-workflows.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@ankhorage/devtools': patch
---

Standardize CI/release workflow files and update the Bun tooling baseline.
77 changes: 77 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: CI

on:
pull_request:
push:
branches:
- main

permissions:
contents: read

jobs:
validate:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: '1.3.13'

- name: Install dependencies
run: bun install --frozen-lockfile

- name: Run build
run: |
if node -e "const p=require('./package.json'); process.exit(p.scripts?.build ? 0 : 1)"; then
bun run build
else
echo "No build script found; skipping."
fi

- name: Run lint
run: |
if node -e "const p=require('./package.json'); process.exit(p.scripts?.lint ? 0 : 1)"; then
bun run lint
else
echo "No lint script found; skipping."
fi

- name: Run format check
run: |
if node -e "const p=require('./package.json'); process.exit(p.scripts?.['format:check'] ? 0 : 1)"; then
bun run format:check
else
echo "No format:check script found; skipping."
fi

- name: Run tests
run: |
if node -e "const p=require('./package.json'); process.exit(p.scripts?.test ? 0 : 1)"; then
bun run test
else
echo "No test script found; skipping."
fi

- name: Run typecheck
run: |
if node -e "const p=require('./package.json'); process.exit(p.scripts?.typecheck ? 0 : 1)"; then
bun run typecheck
else
echo "No typecheck script found; skipping."
fi

- name: Check changesets
if: github.event_name == 'pull_request'
run: |
if [ -f ./scripts/check-changeset-status.sh ]; then
bash ./scripts/check-changeset-status.sh
else
echo "No changeset status script found; skipping."
fi
65 changes: 65 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Release

on:
push:
branches:
- main

permissions:
contents: write
pull-requests: write
id-token: write

concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false

jobs:
release:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: '1.3.13'

- name: Setup Node for npm publishing
uses: actions/setup-node@v4
with:
node-version: 24
registry-url: https://registry.npmjs.org

- name: Update npm
run: npm install -g npm@latest

- name: Install dependencies
run: bun install --frozen-lockfile

- name: Build package
run: |
if node -e "const p=require('./package.json'); process.exit(p.scripts?.build ? 0 : 1)"; then
bun run build
else
echo "No build script found; skipping."
fi

- name: Create release pull request or publish to npm
if: hashFiles('.changeset/config.json') != ''
uses: changesets/action@v1
with:
version: bun run version-packages
publish: bunx changeset publish
commit: Version Packages
title: Version Packages
env:
GITHUB_TOKEN: ${{ github.token }}

- name: Skip release
if: hashFiles('.changeset/config.json') == ''
run: echo "No Changesets config found; skipping release."
16 changes: 13 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
"name": "@ankhorage/devtools",
"version": "1.0.1",
"description": "Shared Lint and Format Configuration for Ankhorage",
"homepage": "https://github.com/ankhorage/devtools#readme",
"bugs": {
"url": "https://github.com/ankhorage/devtools/issues"
},
"repository": {
"type": "git",
"url": "git+https://github.com/ankhorage/devtools.git"
},
"type": "module",
"publishConfig": {
"access": "public"
Expand All @@ -26,7 +34,8 @@
"lint": "eslint .",
"format": "prettier --write .",
"format:check": "prettier --check .",
"test": "bun test"
"test": "bun test",
"version-packages": "changeset version"
},
"dependencies": {
"@eslint/js": "^10.0.1",
Expand All @@ -41,8 +50,9 @@
},
"devDependencies": {
"@changesets/cli": "^2.30.0",
"@types/bun": "^1.3.13",
"@types/node": "^25.2.3",
"bun-types": "^1.3.11",
"typescript": "^5.9.3"
}
},
"packageManager": "bun@1.3.13"
}
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"types": ["bun-types"]
"types": ["bun"]
},
"include": ["src/**/*"],
"exclude": ["src/**/*.test.ts"]
Expand Down
Loading