Skip to content

Commit 3a23b2b

Browse files
committed
added release github action
1 parent 28e3527 commit 3a23b2b

File tree

3 files changed

+72
-3
lines changed

3 files changed

+72
-3
lines changed

.github/workflows/release.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: CI & Release
2+
3+
on:
4+
push:
5+
branches: [main]
6+
tags:
7+
- "v*"
8+
pull_request:
9+
branches: [main]
10+
11+
jobs:
12+
check:
13+
name: Lint & Typecheck
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- uses: oven-sh/setup-bun@v2
19+
with:
20+
bun-version: latest
21+
cache: true
22+
23+
- name: Install dependencies
24+
run: bun install
25+
26+
- name: Run Biome check
27+
run: bun run check
28+
29+
- name: Run typecheck
30+
run: bun run typecheck
31+
32+
build-and-release:
33+
name: Build & Release
34+
needs: check
35+
if: startsWith(github.ref, 'refs/tags/v')
36+
runs-on: ubuntu-latest
37+
permissions:
38+
contents: write
39+
steps:
40+
- uses: actions/checkout@v4
41+
42+
- uses: oven-sh/setup-bun@v2
43+
with:
44+
bun-version: latest
45+
cache: true
46+
47+
- name: Install dependencies
48+
run: bun install
49+
50+
- name: Build all platforms
51+
run: bun run build:all
52+
53+
- name: Generate checksums
54+
run: |
55+
cd build
56+
sha256sum * > checksums.txt
57+
58+
- name: Create Release
59+
uses: softprops/action-gh-release@v2
60+
with:
61+
generate_release_notes: true
62+
files: |
63+
build/treeEx-linux-x64
64+
build/treeEx-linux-arm64
65+
build/treeEx-darwin-x64
66+
build/treeEx-darwin-arm64
67+
build/treeEx-windows-x64.exe
68+
build/checksums.txt

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,15 @@
1111
"start": "bun run index.ts",
1212
"build": "bun build index.ts --compile --outfile build/treeEx",
1313
"build:linux": "bun build index.ts --compile --target=bun-linux-x64 --outfile build/treeEx-linux-x64",
14+
"build:linux-arm": "bun build index.ts --compile --target=bun-linux-arm64 --outfile build/treeEx-linux-arm64",
1415
"build:macos": "bun build index.ts --compile --target=bun-darwin-x64 --outfile build/treeEx-darwin-x64",
1516
"build:macos-arm": "bun build index.ts --compile --target=bun-darwin-arm64 --outfile build/treeEx-darwin-arm64",
1617
"build:windows": "bun build index.ts --compile --target=bun-windows-x64 --outfile build/treeEx-windows-x64.exe",
17-
"build:all": "bun run build:linux && bun run build:macos && bun run build:macos-arm && bun run build:windows",
18+
"build:all": "bun run build:linux && bun run build:linux-arm && bun run build:macos && bun run build:macos-arm && bun run build:windows",
1819
"build:clean": "rm -rf build/",
1920
"typecheck": "tsc --noEmit",
2021
"lint": "biome lint .",
21-
"format": "biome format . --write",
22+
"format": "biome check . --write",
2223
"check": "biome check ."
2324
},
2425
"devDependencies": {

src/cli.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function parseDepth(value: string): number | "inf" {
1111
return "inf";
1212
}
1313
const num = parseInt(value, 10);
14-
if (isNaN(num) || num < 0) {
14+
if (Number.isNaN(num) || num < 0) {
1515
console.error(
1616
`Error: Invalid depth value "${value}". Must be a positive number or "inf".`
1717
);

0 commit comments

Comments
 (0)