CI
This commit is contained in:
+111
-47
@@ -1,68 +1,132 @@
|
||||
# peardock release process
|
||||
|
||||
## Server tarball + checksums
|
||||
## Artifacts
|
||||
|
||||
```bash
|
||||
chmod +x scripts/release-checksums.sh
|
||||
./scripts/release-checksums.sh dist/
|
||||
# Optional GPG:
|
||||
GPG_KEY_ID=YOUR_KEY_ID ./scripts/release-checksums.sh dist/
|
||||
```
|
||||
| Artifact | Builder | Platforms |
|
||||
|----------|---------|-----------|
|
||||
| **peardock-server** | Bare `bare-build --standalone` via `scripts/bare-standalone.cjs` | `linux-x64`, `linux-arm64`, `darwin-arm64`, `darwin-x64`, `win32-x64` (cross-compile OK) |
|
||||
| **peardock-client** | Electron Forge (`electron-forge package`) | Same hosts; **native rebuild** prefers a matching OS runner |
|
||||
|
||||
Artifacts:
|
||||
Server packing uses `package.json` `imports` (full **bare-node-runtime** map) so Node builtins resolve to `bare-*` modules inside the Bare standalone binary. Optional natives (`ssh2`, `@grpc/*`) map to stubs under `build/stubs/`.
|
||||
|
||||
| File | Purpose |
|
||||
|------|---------|
|
||||
| `peardock-<ver>-<stamp>.tar.gz` | Source/runtime tree (no node_modules) |
|
||||
| `*.sha256` | SHA-256 checksum |
|
||||
| `*.asc` | Detached GPG signature (if keyed) |
|
||||
Client packing:
|
||||
|
||||
Verify:
|
||||
1. `npm run build:client-bundle` → `electron/app.bundle.cjs` (esbuild CJS of the GUI)
|
||||
2. `electron-forge package` with `forge.config.cjs` (`asar: false`, aggressive ignore list)
|
||||
3. Main process: `electron/main.cjs` (static server + Holesail control + Pear polyfill)
|
||||
|
||||
```bash
|
||||
cd dist
|
||||
sha256sum -c peardock-*.sha256
|
||||
gpg --verify peardock-*.tar.gz.asc peardock-*.tar.gz # if signed
|
||||
```
|
||||
---
|
||||
|
||||
## Server install from release
|
||||
|
||||
```bash
|
||||
tar -xzf peardock-*.tar.gz -C /opt/peardock
|
||||
cd /opt/peardock && npm ci --omit=dev
|
||||
cp deploy/peardock.service /etc/systemd/system/
|
||||
systemctl enable --now peardock
|
||||
```
|
||||
|
||||
## Pear desktop app
|
||||
## Local builds
|
||||
|
||||
```bash
|
||||
npm ci
|
||||
pear stage .
|
||||
pear release .
|
||||
# Distribute pear:// link or channel per Pear docs
|
||||
|
||||
# Server — this host only
|
||||
npm run make:bin
|
||||
# or explicit:
|
||||
npm run make:server:linux-x64
|
||||
npm run make:server:darwin-arm64
|
||||
|
||||
# Server — all hosts
|
||||
npm run make:server
|
||||
|
||||
# Client — this host
|
||||
npm run start:client # dev
|
||||
npm run make:client:darwin-arm64
|
||||
# Windows / Linux equivalents: make:client:win32-x64, make:client:linux-x64, …
|
||||
|
||||
# Both (server all hosts + client this host)
|
||||
npm run make
|
||||
```
|
||||
|
||||
Outputs:
|
||||
|
||||
```
|
||||
out/peardock-server-<host>/peardock-server[.exe]
|
||||
out/peardock-<platform>-<arch>/ # Electron app tree (e.g. peardock.app on macOS)
|
||||
```
|
||||
|
||||
### Server install smoke
|
||||
|
||||
```bash
|
||||
./out/peardock-server-linux-x64/peardock-server
|
||||
# prints public key; needs Docker socket
|
||||
```
|
||||
|
||||
### Client smoke
|
||||
|
||||
```bash
|
||||
open out/peardock-darwin-arm64/peardock.app # macOS
|
||||
# or ./out/peardock-linux-x64/peardock-client
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Gitea CI rolling release
|
||||
|
||||
Workflow: [`.gitea/workflows/release-rolling.yml`](../.gitea/workflows/release-rolling.yml)
|
||||
|
||||
Script: [`scripts/gitea-rolling-release.sh`](../scripts/gitea-rolling-release.sh)
|
||||
|
||||
| Secret | Purpose |
|
||||
|--------|---------|
|
||||
| **`RELEASE_TOKEN`** | Gitea PAT with **repository release** read/write (required) |
|
||||
| `GITEA_URL` | Optional forge base URL if not inferred from `origin` / Actions context |
|
||||
|
||||
On push to `main` (and `workflow_dispatch`):
|
||||
|
||||
1. `npm ci` + `npm test`
|
||||
2. Build **all server hosts** with bare-build (cross from Ubuntu)
|
||||
3. Build **linux-x64 client** with electron-forge on the Ubuntu runner
|
||||
4. Stage `dist/release/*.tar.gz` + `*.sha256`
|
||||
5. Recreate tag/release **`rolling`** and upload assets via Gitea API
|
||||
|
||||
Dry-run locally (no upload):
|
||||
|
||||
```bash
|
||||
DRY_RUN=1 bash scripts/gitea-rolling-release.sh
|
||||
# or with upload:
|
||||
RELEASE_TOKEN=… GITEA_URL=https://your.gitea GITEA_OWNER=… GITEA_REPO=peardock \
|
||||
bash scripts/gitea-rolling-release.sh
|
||||
```
|
||||
|
||||
### Multi-OS client binaries
|
||||
|
||||
Ubuntu CI produces **linux-x64** client only (Electron native modules). For darwin/win32 clients:
|
||||
|
||||
- Run `npm run make:client:darwin-arm64` (etc.) on matching machines and attach archives to the release, or
|
||||
- Enable optional self-hosted matrix jobs in `release-rolling.yml` (commented template included).
|
||||
|
||||
Server binaries for all five hosts are produced from Linux via bare-runtime prebuilds.
|
||||
|
||||
---
|
||||
|
||||
## Source tarball + checksums (legacy)
|
||||
|
||||
```bash
|
||||
./scripts/release-checksums.sh dist/
|
||||
GPG_KEY_ID=YOUR_KEY_ID ./scripts/release-checksums.sh dist/
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## bare-node-runtime notes
|
||||
|
||||
- `package.json` `imports` mirror [bare-node-runtime/imports](https://github.com/holepunchto/bare-node-runtime) so `fs` / `http` / `net` / … resolve to `bare-fs` / `bare-http1` / `bare-net` under Bare.
|
||||
- Entry `bin/peardock-server.mjs` loads `bare-node-runtime/global` only when `globalThis.Bare` is set.
|
||||
- Stack references: `hello-pear-bare-worker` (`bare-build --standalone --host …`), `bare-build`, `bare-runtime`, `bare-node-runtime`.
|
||||
|
||||
---
|
||||
|
||||
## Certification soak (24h)
|
||||
|
||||
```bash
|
||||
# Terminal 1
|
||||
npm run server
|
||||
|
||||
# Terminal 2 — 24 hours
|
||||
SOAK_DURATION_MS=86400000 npm run soak
|
||||
# or: node scripts/soak.js --hours 24
|
||||
# other terminal:
|
||||
npm run soak:24h
|
||||
```
|
||||
|
||||
Exit 0 = Docker remained reachable within failure threshold.
|
||||
|
||||
## Load / fuzz in CI
|
||||
|
||||
Included in `npm test`:
|
||||
|
||||
- `test/load.test.js` — concurrent HyperDHT pings
|
||||
- `test/fuzz.test.js` — schema/role fuzz
|
||||
|
||||
## Encoding profile
|
||||
|
||||
Handshake returns `schemaVersion` and features. Default encoding remains JSON (`shared/encodings.js`); binary bulk uses `binaryStream*` + `push:binaryChunk`. Hyperschema can replace JSON value encodings without renaming methods.
|
||||
Handshake returns `schemaVersion` and features. Default encoding remains JSON (`shared/encodings.js`); binary bulk uses `binaryStream*` + `push:binaryChunk`.
|
||||
|
||||
Reference in New Issue
Block a user