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

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

jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- run: bun i --frozen-lockfile
- run: bunx nx run-many -t lint test
- run: bunx nx build desktop --configuration=dev
22 changes: 22 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Release

on:
push:
tags: ['v*']

permissions:
contents: write

jobs:
release:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- run: bun install --frozen-lockfile
- run: bun run build:stable
- uses: softprops/action-gh-release@v2
with:
files: artifacts/*
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,24 @@ bun run dev # runs `nx serve app` (Angular dev server, HMR) + `electrobun dev`

The desktop shell (Bun main process, window/menu/tray code) lives in `apps/desktop/src`, separate from the Angular UI in `apps/app` — they're different runtimes with different tsconfigs. Edit `apps/desktop/src/index.ts` and restart `electrobun dev` manually to see changes — do not use `electrobun dev --watch` on Windows, see below.

## Releasing

```bash
bun run release # every release after the first
bun run release -- --dry-run # preview what it would do, changes nothing
```

This runs `nx release --skip-publish`, which bumps the version (from Conventional Commits since the last tag), writes `CHANGELOG.md`, commits, tags (`vX.Y.Z`), pushes, and creates the GitHub Release itself (via your authenticated `gh` CLI or a `GITHUB_TOKEN`/`GH_TOKEN` env var) — no npm/Docker publish step runs. That tag push then triggers [`.github/workflows/release.yml`](.github/workflows/release.yml), which builds the app (`bun run build:stable`) and uploads the `.exe`/`.zip` from `artifacts/` to that same release as downloadable assets.

For the very first release ever, there's no prior tag to diff from, so add `--first-release`:

```bash
bun run release -- --first-release --dry-run # preview first
bun run release -- --first-release
```

Versions live in three places kept in sync by `nx release` (`nx.json`'s `release.version.manifestRootsToUpdate`): the root `package.json` (which `electrobun.config.ts` reads for `app.version`), and `apps/app/package.json` / `apps/desktop/package.json` (present only so Nx has a manifest to read/write per project — this is an integrated Nx workspace with no other use for per-project `package.json` files).

### Known issues

- **Killing `electrobun dev` leaves orphaned processes on Windows** ([electrobun#168](https://github.com/blackboardsh/electrobun/issues/168)): killing the app only kills the top-level `launcher.exe`; the actual `bun.exe` process and its WebView2 tree survive. Two symptoms:
Expand Down
4 changes: 4 additions & 0 deletions apps/app/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "app",
"version": "0.0.1"
}
4 changes: 4 additions & 0 deletions apps/desktop/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "desktop",
"version": "0.0.1"
}
3 changes: 3 additions & 0 deletions electrobun.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,7 @@ export default {
bundleCEF: false,
},
},
release: {
baseUrl: 'https://github.com/draylegend/letora/releases/latest/download',
},
} satisfies ElectrobunConfig;
18 changes: 18 additions & 0 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,23 @@
"style": "css",
"unitTestRunner": "vitest"
}
},
"release": {
"projects": ["app", "desktop"],
"version": {
"conventionalCommits": true,
"manifestRootsToUpdate": ["."]
},
"changelog": {
"automaticFromRef": true,
"workspaceChangelog": {
"createRelease": "github"
}
},
"git": {
"commit": true,
"tag": true,
"push": true
}
}
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
"scripts": {
"prepare": "husky",
"dev": "nx serve desktop",
"build:stable": "nx build desktop"
"build:stable": "nx build desktop",
"release": "nx release --skip-publish"
},
"private": true,
"dependencies": {
Expand Down
Loading