Skip to content
Merged
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
33 changes: 33 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: CI

on:
push:
branches: [dev]
pull_request:
branches: [dev]

jobs:
check:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: oven-sh/setup-bun@v2

- uses: actions/setup-node@v4
with:
node-version: 20

- run: bun install

- run: bun install
working-directory: packages/server

- run: npm install
working-directory: packages/desktop

- run: npm run check

- run: bun test
working-directory: packages/server
105 changes: 105 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: Release

on:
push:
tags:
- 'v*.*.*'

jobs:
build-mac:
runs-on: macos-latest

steps:
- uses: actions/checkout@v4

- uses: oven-sh/setup-bun@v2

- uses: actions/setup-node@v4
with:
node-version: 20

- run: bun run scripts/prepare-cloudflared.ts

- run: bun install
working-directory: packages/server

- run: bun run build
working-directory: packages/server

- run: npm install
working-directory: packages/desktop

- run: npm run build
working-directory: packages/desktop

- run: npm run dist:mac
working-directory: packages/desktop

- uses: actions/upload-artifact@v4
with:
name: mac-build
path: packages/desktop/dist/*.dmg

build-win:
runs-on: windows-latest

steps:
- uses: actions/checkout@v4

- uses: oven-sh/setup-bun@v2

- uses: actions/setup-node@v4
with:
node-version: 20

- run: bun run scripts/prepare-cloudflared.ts

- run: bun install
working-directory: packages/server

- run: bun run build
working-directory: packages/server

- run: npm install
working-directory: packages/desktop

- run: npm run build
working-directory: packages/desktop

- run: npm run dist:win
working-directory: packages/desktop

- uses: actions/upload-artifact@v4
with:
name: win-build
path: packages/desktop/dist/*.exe

release:
needs: [build-mac, build-win]
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- uses: actions/checkout@v4

- uses: actions/download-artifact@v4
with:
name: mac-build
path: ./artifacts/mac

- uses: actions/download-artifact@v4
with:
name: win-build
path: ./artifacts/win

- name: Create Release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
TAG=${GITHUB_REF#refs/tags/}
gh release create "$TAG" \
./artifacts/mac/*.dmg \
./artifacts/win/*.exe \
--title "$TAG" \
--generate-notes
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "persona-agent",
"version": "1.0.0",
"version": "1.0.1",
"private": true,
"scripts": {
"dev": "cd packages/desktop && npm run dev",
Expand All @@ -13,6 +13,7 @@
"format": "prettier --write \"packages/*/src/**/*.{ts,tsx}\"",
"format:check": "prettier --check \"packages/*/src/**/*.{ts,tsx}\"",
"check": "npm run lint && npm run format:check && npm run typecheck",
"bump": "bun run scripts/bump-version.ts",
"prepare": "husky"
},
"devDependencies": {
Expand Down
15 changes: 15 additions & 0 deletions packages/desktop/electron-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,24 @@ extraResources:
to: "bin/persona-agent-server"
- from: "../server/bin/cloudflared"
to: "bin/cloudflared"
filter:
- "**/*"

mac:
icon: "build/icon-mac.png"
target:
- target: dmg
arch:
- arm64
- x64

win:
icon: "build/icon-win.png"
target:
- target: nsis
arch:
- x64

nsis:
oneClick: false
allowToChangeInstallationDirectory: true
7 changes: 4 additions & 3 deletions packages/desktop/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "persona-agent-desktop",
"version": "1.0.0",
"version": "1.0.1",
"description": "Persona Desktop - Electron GUI for Persona",
"type": "module",
"main": "./out/main/index.js",
Expand All @@ -12,7 +12,9 @@
"typecheck": "tsc --noEmit",
"test": "vitest",
"pack": "electron-builder --dir",
"dist": "electron-builder"
"dist": "electron-builder",
"dist:mac": "electron-builder --mac",
"dist:win": "electron-builder --win"
},
"keywords": [
"electron",
Expand Down Expand Up @@ -41,7 +43,6 @@
"rehype-highlight": "^7.0.0",
"remark-gfm": "^4.0.0",
"tailwind-merge": "^2.2.0",

"zustand": "^4.5.0"
},
"devDependencies": {
Expand Down
8 changes: 8 additions & 0 deletions packages/server/bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion packages/server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "persona-agent-server",
"version": "1.0.0",
"version": "1.0.1",
"type": "module",
"bin": {
"persona-agent-server": "dist/src/index.js"
Expand All @@ -18,6 +18,7 @@
"server": "bun run src/server/standalone.ts"
},
"devDependencies": {
"@types/bun": "^1.2.0",
"@types/cors": "^2.8.19",
"@types/express": "^5.0.6",
"@types/multer": "^2.1.0",
Expand All @@ -34,6 +35,7 @@
"@modelcontextprotocol/sdk": "^1.28.0",
"@anthropic-ai/sdk": "^0.90.0",
"@mariozechner/pi-ai": "0.70.2",
"@sinclair/typebox": "^0.34.0",
"chalk": "^5.6.2",
"cloudflared": "^0.7.1",
"commander": "^14.0.2",
Expand Down
6 changes: 1 addition & 5 deletions packages/server/src/server/routers/tunnel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@

import { Router } from 'express';
import type { Request, Response } from 'express';
import {
startTunnel,
stopTunnel,
getTunnelStatus,
} from '../tunnel-service.js';
import { startTunnel, stopTunnel, getTunnelStatus } from '../tunnel-service.js';
import { httpServer } from '../index.js';
import { Logger } from '../../util/logger.js';

Expand Down
34 changes: 34 additions & 0 deletions scripts/bump-version.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { readFileSync, writeFileSync } from 'node:fs';
import { resolve } from 'node:path';

const semverRegex = /^\d+\.\d+\.\d+$/;

const version = process.argv[2];
if (!version || !semverRegex.test(version)) {
console.error(
'Usage: bun run scripts/bump-version.ts <version>\nExample: bun run scripts/bump-version.ts 1.0.1',
);
process.exit(1);
}

const files = [
'package.json',
'packages/server/package.json',
'packages/desktop/package.json',
];

const rootDir = resolve(import.meta.dirname, '..');

for (const file of files) {
const filePath = resolve(rootDir, file);
const content = readFileSync(filePath, 'utf-8');
const json = JSON.parse(content);

const oldVersion = json.version;
json.version = version;

writeFileSync(filePath, JSON.stringify(json, null, 2) + '\n');
console.log(`${file}: ${oldVersion} → ${version}`);
}

console.log(`\nDone. All three package.json updated to v${version}.`);
Loading
Loading