Skip to content

Commit b2911b1

Browse files
committed
Add CI
1 parent 008f345 commit b2911b1

35 files changed

+3568
-1176
lines changed

.github/workflows/ci.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
ci:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
17+
- name: Setup Bun
18+
uses: oven-sh/setup-bun@v2
19+
with:
20+
bun-version: latest
21+
22+
- name: Install dependencies
23+
run: bun install
24+
25+
- name: Check formatting
26+
run: bun run fmt:check
27+
28+
- name: Typecheck
29+
run: bun run typecheck
30+
31+
- name: Lint
32+
run: bun run lint
33+
34+
- name: Test
35+
run: bun run test

.github/workflows/release.yml

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
workflow_dispatch:
8+
inputs:
9+
version:
10+
description: "Version to release (e.g., 0.1.0)"
11+
required: true
12+
13+
permissions:
14+
contents: write
15+
16+
jobs:
17+
release:
18+
strategy:
19+
matrix:
20+
include:
21+
- os: macos-latest
22+
platform: mac
23+
- os: ubuntu-latest
24+
platform: linux
25+
- os: windows-latest
26+
platform: win
27+
28+
runs-on: ${{ matrix.os }}
29+
30+
steps:
31+
- name: Checkout
32+
uses: actions/checkout@v4
33+
34+
- name: Setup Bun
35+
uses: oven-sh/setup-bun@v2
36+
with:
37+
bun-version: latest
38+
39+
- name: Install dependencies
40+
run: bun install
41+
42+
- name: Build browser bundle
43+
run: bun run build:browser
44+
45+
- name: Generate icons
46+
run: bun run icons
47+
48+
# macOS: Import certificates for code signing
49+
- name: Import macOS certificates
50+
if: matrix.platform == 'mac'
51+
env:
52+
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
53+
MACOS_CERTIFICATE_PWD: ${{ secrets.MACOS_CERTIFICATE_PWD }}
54+
MACOS_KEYCHAIN_PWD: ${{ secrets.MACOS_KEYCHAIN_PWD }}
55+
run: |
56+
if [ -n "$MACOS_CERTIFICATE" ]; then
57+
echo "Importing macOS certificate..."
58+
echo $MACOS_CERTIFICATE | base64 --decode > certificate.p12
59+
security create-keychain -p "$MACOS_KEYCHAIN_PWD" build.keychain
60+
security default-keychain -s build.keychain
61+
security unlock-keychain -p "$MACOS_KEYCHAIN_PWD" build.keychain
62+
security import certificate.p12 -k build.keychain -P "$MACOS_CERTIFICATE_PWD" -T /usr/bin/codesign
63+
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$MACOS_KEYCHAIN_PWD" build.keychain
64+
rm certificate.p12
65+
else
66+
echo "No macOS certificate provided, skipping code signing"
67+
fi
68+
69+
# Build and publish
70+
- name: Build Electron app
71+
run: bun run scripts/build-electron.ts
72+
73+
- name: Publish to GitHub Releases
74+
env:
75+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
76+
# macOS signing
77+
CSC_LINK: ${{ secrets.MACOS_CERTIFICATE }}
78+
CSC_KEY_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PWD }}
79+
# macOS notarization
80+
APPLE_ID: ${{ secrets.APPLE_ID }}
81+
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }}
82+
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
83+
# Windows signing
84+
WIN_CSC_LINK: ${{ secrets.WIN_CERTIFICATE }}
85+
WIN_CSC_KEY_PASSWORD: ${{ secrets.WIN_CERTIFICATE_PWD }}
86+
run: |
87+
npx electron-builder --config electron-builder.json --${{ matrix.platform }} --publish always
88+
89+
# Upload artifacts for debugging
90+
- name: Upload artifacts
91+
uses: actions/upload-artifact@v4
92+
with:
93+
name: release-${{ matrix.platform }}
94+
path: |
95+
release/*.dmg
96+
release/*.zip
97+
release/*.exe
98+
release/*.AppImage
99+
release/*.tar.gz
100+
release/*.yml
101+
if-no-files-found: ignore

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,5 @@ yarn-error.log*
4040
*.tsbuildinfo
4141
next-env.d.ts
4242

43-
dist/
43+
dist/
44+
release/

.prettierrc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"semi": true,
3+
"trailingComma": "es5",
4+
"singleQuote": false,
5+
"printWidth": 80,
6+
"tabWidth": 2,
7+
"useTabs": false
8+
}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ There is a live hosted demo where you can read-only tinker with the UX.
1414

1515
## Install
1616

17-
Download the
17+
Download the

build.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,3 @@ await $`chmod +x ./dist/pullpal.js`;
2424
await $`mv ./dist/pullpal.js ./dist/pullpal`;
2525

2626
console.log("✅ Build complete: ./dist/pullpal");
27-

bun.lock

Lines changed: 805 additions & 2 deletions
Large diffs are not rendered by default.

electron-builder.json

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/electron-userland/electron-builder/master/packages/app-builder-lib/scheme.json",
3+
"appId": "com.coder.pullpal",
4+
"productName": "Pullpal",
5+
"copyright": "Copyright © 2025 Coder",
6+
7+
"directories": {
8+
"output": "release",
9+
"buildResources": "build",
10+
"app": "dist"
11+
},
12+
13+
"files": ["electron/**/*", "browser/**/*", "!browser/**/*.map"],
14+
15+
"extraResources": [
16+
{
17+
"from": "dist/browser",
18+
"to": "browser",
19+
"filter": ["**/*", "!**/*.map"]
20+
}
21+
],
22+
23+
"mac": {
24+
"category": "public.app-category.developer-tools",
25+
"icon": "build/icon.icns",
26+
"darkModeSupport": true,
27+
"hardenedRuntime": true,
28+
"gatekeeperAssess": false,
29+
"target": [
30+
{
31+
"target": "dmg",
32+
"arch": ["x64", "arm64"]
33+
},
34+
{
35+
"target": "zip",
36+
"arch": ["x64", "arm64"]
37+
}
38+
]
39+
},
40+
41+
"dmg": {
42+
"icon": "build/icon.icns",
43+
"iconSize": 128,
44+
"contents": [
45+
{
46+
"x": 130,
47+
"y": 220
48+
},
49+
{
50+
"x": 410,
51+
"y": 220,
52+
"type": "link",
53+
"path": "/Applications"
54+
}
55+
],
56+
"window": {
57+
"width": 540,
58+
"height": 380
59+
}
60+
},
61+
62+
"win": {
63+
"icon": "build/icon.ico",
64+
"target": [
65+
{
66+
"target": "nsis",
67+
"arch": ["x64", "arm64"]
68+
},
69+
{
70+
"target": "portable",
71+
"arch": ["x64"]
72+
}
73+
]
74+
},
75+
76+
"nsis": {
77+
"oneClick": false,
78+
"perMachine": false,
79+
"allowToChangeInstallationDirectory": true,
80+
"deleteAppDataOnUninstall": true,
81+
"installerIcon": "build/icon.ico",
82+
"uninstallerIcon": "build/icon.ico",
83+
"installerHeaderIcon": "build/icon.ico",
84+
"createDesktopShortcut": true,
85+
"createStartMenuShortcut": true,
86+
"shortcutName": "Pullpal"
87+
},
88+
89+
"linux": {
90+
"icon": "build/icon.png",
91+
"category": "Development",
92+
"target": [
93+
{
94+
"target": "AppImage",
95+
"arch": ["x64", "arm64"]
96+
},
97+
{
98+
"target": "tar.gz",
99+
"arch": ["x64", "arm64"]
100+
}
101+
],
102+
"synopsis": "Fast GitHub PR Reviews",
103+
"description": "A lightning-fast, local PR review dashboard with syntax highlighting."
104+
},
105+
106+
"publish": {
107+
"provider": "github",
108+
"owner": "coder",
109+
"repo": "pullpal",
110+
"releaseType": "release"
111+
}
112+
}

package.json

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,27 @@
99
"files": [
1010
"dist"
1111
],
12+
"main": "dist/electron/main.js",
1213
"scripts": {
1314
"dev": "concurrently \"bun run build:browser --watch\" \"bun run dev:node\"",
1415
"dev:node": "bun run src/node/main.ts",
15-
"build:browser": "bun run ./scripts/build-browser.ts"
16+
"typecheck": "tsgo --noEmit",
17+
"build:browser": "bun run ./scripts/build-browser.ts",
18+
"electron:dev": "concurrently \"bun run build:browser --watch\" \"bun run scripts/electron-dev.ts\"",
19+
"electron:build": "bun run scripts/build-electron.ts",
20+
"electron:package": "bun run electron:build && electron-builder --config electron-builder.json",
21+
"electron:package:mac": "bun run electron:build && electron-builder --config electron-builder.json --mac",
22+
"electron:package:win": "bun run electron:build && electron-builder --config electron-builder.json --win",
23+
"electron:package:linux": "bun run electron:build && electron-builder --config electron-builder.json --linux",
24+
"electron:publish": "bun run electron:build && electron-builder --config electron-builder.json --publish always",
25+
"electron:publish:mac": "bun run electron:build && electron-builder --config electron-builder.json --mac --publish always",
26+
"electron:publish:win": "bun run electron:build && electron-builder --config electron-builder.json --win --publish always",
27+
"electron:publish:linux": "bun run electron:build && electron-builder --config electron-builder.json --linux --publish always",
28+
"icons": "bun run scripts/generate-icons.ts",
29+
"fmt": "prettier --write --cache .",
30+
"fmt:check": "prettier --check .",
31+
"lint": "echo 'No linter configured yet'",
32+
"test": "echo 'No tests configured yet'"
1633
},
1734
"keywords": [
1835
"github",
@@ -22,6 +39,11 @@
2239
"cli"
2340
],
2441
"license": "MIT",
42+
"author": {
43+
"name": "Coder",
44+
"email": "support@coder.com",
45+
"url": "https://coder.com"
46+
},
2547
"dependencies": {
2648
"@radix-ui/react-collapsible": "^1.1.12",
2749
"@radix-ui/react-context-menu": "^2.2.16",
@@ -32,6 +54,7 @@
3254
"clsx": "^2.1.1",
3355
"cmdk": "^1.1.1",
3456
"diff": "^8.0.2",
57+
"electron-updater": "^6.6.2",
3558
"gitdiff-parser": "^0.3.1",
3659
"lucide-react": "^0.555.0",
3760
"react-markdown": "^10.1.0",
@@ -42,18 +65,26 @@
4265
"tw-animate-css": "^1.4.0"
4366
},
4467
"devDependencies": {
68+
"@electron/asar": "^4.0.1",
4569
"@hono/node-server": "^1.19.6",
4670
"@octokit/core": "^7.0.6",
4771
"@types/bun": "latest",
4872
"@types/react": "^19",
4973
"@types/react-dom": "^19",
74+
"@typescript/native-preview": "^7.0.0-dev.20251201.1",
5075
"bun-plugin-tailwind": "latest",
5176
"concurrently": "^9.2.1",
77+
"electron": "^39.2.4",
78+
"electron-builder": "^26.0.12",
5279
"geist": "^1.5.1",
5380
"hono": "^4.10.7",
81+
"png2icons": "^2.0.1",
82+
"prettier": "^3.7.3",
5483
"react": "19.2.0",
5584
"react-dom": "19.2.0",
85+
"sharp": "^0.34.5",
5686
"tailwindcss": "^4",
87+
"tsx": "^4.21.0",
5788
"typescript": "^5"
5889
}
5990
}

0 commit comments

Comments
 (0)