Files
luminary/windows/SEPARATE-REPO.md
T
bhursey 7eac7e7ecf Release 0.5.3.1
Ships the offline-start fix for the Windows launcher and the before/after split.
2026-12-01 12:14:31 +00:00

150 lines
5.6 KiB
Markdown

# Separate packaging repository (`luminary-windows`)
This is the fallback path if the `windows/` folder in this repo ever feels too
close to the app: a second repository that builds the same bundle from a pinned
upstream tag. It is a plan, not something that exists yet.
## Why a packaging repo and not a fork
A fork duplicates the app and forces a merge of every upstream change. Nothing
in Luminary is Windows-specific — the server is plain ESM, `node:sqlite` and
`sharp`/`libraw-wasm` ship Windows builds, and the only POSIX-ism
(`secret.key` mode `0o600`) is ignored by Windows. The Windows work is
therefore *packaging*: a fixed folder layout, a Node runtime, a launcher and an
artifact. A packaging repo keeps that work under a separate review and release
process while consuming the app unchanged.
A fork remains justified only if a Windows build ever needs an app patch
(behaviour, not packaging). If that happens, the change belongs upstream in the
main repo first.
## Repository layout
```
luminary-windows/
upstream.txt # pinned tag + commit + expected package version
build.mjs # same script as windows/build.mjs, one copy
launcher/ # Luminary.ps1, .cmd, .vbs, Stop, go/
installer.nsi # NSIS, builds on Linux
Dockerfile # Go + Node 24 image for the exe build
README.md
CHANGELOG.md # per-release: upstream tag, node version, hashes
```
`build.mjs` is copied verbatim from the main repo when it changes; there is no
second implementation to drift.
## Pinning
`upstream.txt`:
```
repo=https://git.maple-street.net/bhursey/luminary.git
tag=v0.5.3.1
commit=fb43ca8f1c2d… # full sha
version=0.5.3.1 # package.json version, checked after fetch
node=v24.22.2
```
The build clones the upstream repository at the pinned commit (shallow clone of
the tag, then `git rev-parse HEAD` must equal `commit`) into a work directory
outside both repos, for example:
```
$TMP/luminary-upstream/
```
If the tag moves or the commit does not match, the build fails rather than
silently shipping something else. A `--upstream-ref <sha>` flag allows a
one-off build from a newer commit before the pin is updated.
## Build flow
```
fetch pinned upstream (clone/verify)
→ npm ci (dev deps, needed for vite)
→ npm run build (typecheck + dist/)
→ stage: dist, server, production node_modules (--os=win32 --cpu=x64),
node.exe (SHA-256 verified), launcher, licences
→ zip + sha256
→ optional: iscc installer
```
Exactly the same steps as `windows/build.mjs`; the only difference is where
`dist/`, `server/` and `package.json` come from (a work tree, not `../`).
## CI (Gitea Actions, since the remote is Gitea)
`.gitea/workflows/windows.yml` in the packaging repo:
```yaml
name: windows-bundle
on:
workflow_dispatch:
push:
tags: ['v*']
jobs:
build:
runs-on: ubuntu-latest # or a Windows runner for the installer
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with: { node-version: 24 }
- run: node build.mjs --out "$RUNNER_TEMP/out"
- run: sha256sum Luminary-*.zip >> "$RUNNER_TEMP/out/SHA256SUMS"
working-directory: ${{ runner.temp }}/out
- uses: actions/upload-artifact@v4
with:
name: luminary-windows-${{ github.ref_name }}
path: ${{ runner.temp }}/out/*
```
Optional later steps: `softprops/action-gh-release` to attach the zip and setup
exe to a Gitea release. NSIS runs on the Linux runner too (`--installer`), so a
Windows runner is not needed for the installer.
## Release and version policy
- One packaging release per upstream tag that should be installable on Windows;
the artifacts are `Luminary-<version>-win-x64-setup.exe` and the portable
`Luminary-<version>-win-x64.zip`.
- `CHANGELOG.md` records upstream tag/commit, bundled Node version, artifact
SHA-256 and any launcher change.
- Security fixes: when upstream ships one, the pin moves, the packaging tag
increments (`v1.0.1-win.1` style if needed) and the artifact is rebuilt.
- Windows-only changes (launcher, installer) release independently — they do not
require an upstream bump, because they never touch `app/`.
## Updating users
The bundle is portable: replacing `app\` and `node.exe` is the update. Keep the
data folder (`%LOCALAPPDATA%\Luminary\data`) untouched. A future auto-updater
would read a small JSON manifest beside the release and download the zip; that
is a packaging-repo feature, not an app change.
## Migration from the in-repo `windows/` folder
1. Create the new repo.
2. Copy `windows/` to its root (`build.mjs`, `launcher/`, `installer.nsi`,
`Dockerfile`, this plan and `README.md`), adjusting the input paths in
`build.mjs` to the fetched upstream work tree.
3. Add `upstream.txt`, the CI workflow, `CHANGELOG.md`.
4. Build once from the pinned tag and compare the zip contents with the
in-repo build (same files, same launcher) before publishing.
5. Optionally delete `windows/` from the main repo afterwards; nothing in the
app depends on it.
## Trade-offs
| | In-repo `windows/` (current) | Separate repo |
| --- | --- | --- |
| Upstream awareness | always the local checkout | explicit pin, can lag |
| Review/CI noise | one extra folder | separate pipeline |
| Release discipline | none required | tag + changelog per artifact |
| Risk to the app | none (folder only) | none (no files in the app repo) |
| Effort | zero extra repos | one more repo and workflow |
Stay with the in-repo folder while the Windows build changes infrequently;
move to this layout when it needs its own release cadence or a second
maintainer.