From 451a2168933075ff219f2d04357d195e0efa18f6 Mon Sep 17 00:00:00 2001 From: Andre Brait Date: Sun, 1 Nov 2026 10:36:56 +0000 Subject: [PATCH 1/2] ci: publish a binary prerelease for every verified main commit After Verify PR passes on a push to main, build the five single binaries and publish them as a GitHub prerelease titled with its ISO 8601 UTC creation time (tag 20261101T103000Z: git tags cannot hold ':'). The target list moves to scripts/build-release-binaries.sh, shared with publish.yml. --- .github/workflows/prerelease.yml | 57 +++++++++++++++++++++++++++++++ .github/workflows/publish.yml | 9 +---- AGENTS.md | 1 + CHANGELOG.md | 1 + README.md | 4 ++- scripts/build-release-binaries.sh | 10 ++++++ 6 files changed, 73 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/prerelease.yml create mode 100755 scripts/build-release-binaries.sh diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml new file mode 100644 index 000000000..5e3d0bfee --- /dev/null +++ b/.github/workflows/prerelease.yml @@ -0,0 +1,57 @@ +name: Binary prerelease + +# Every commit on main that passed Verify PR becomes a GitHub prerelease carrying the five single binaries, +# named after the time it was created: title 2026-11-01T10:30:00Z, tag 20261101T103000Z (git tags cannot +# hold ":"). Prereleases are never "latest", so the in-app update notice and `v*` releases are unaffected. +on: + workflow_run: + workflows: [Verify PR] + types: [completed] + branches: [main] + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }} + cancel-in-progress: false + +permissions: + contents: write + +jobs: + prerelease: + # A manual run publishes main only: from another branch it would ship that branch's unverified code. + if: (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main') || (github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'push') + runs-on: ubuntu-latest + env: + SHA: ${{ github.event.workflow_run.head_sha || github.sha }} + steps: + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 + with: + ref: ${{ env.SHA }} + # npm ci runs dependency install scripts: keep the write token out of .git/config (gh reads GH_TOKEN). + persist-credentials: false + + - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 + with: + node-version-file: .nvmrc + cache: npm + + - run: npm ci + - run: npm run build + - name: Build the release binaries + run: sh scripts/build-release-binaries.sh + - run: npm run smoke -- --binary release/ompweb-linux-x64/ompweb + + - name: Publish the prerelease + env: + GH_TOKEN: ${{ github.token }} + run: | + now=$(date -u +%s) + title=$(date -u -d "@$now" +%Y-%m-%dT%H:%M:%SZ) + tag=$(date -u -d "@$now" +%Y%m%dT%H%M%SZ) + subject=$(git log -1 --format=%s "$SHA") + # A draft first, so a failed upload never leaves a published prerelease missing archives. + gh release create "$tag" release/ompweb-*.tar.gz release/ompweb-*.zip \ + --repo "$GITHUB_REPOSITORY" --target "$SHA" --draft --prerelease --title "$title" \ + --notes "Binaries built from $GITHUB_REPOSITORY@$SHA ($subject). Not a release: no npm package, no update notice." + gh release edit "$tag" --repo "$GITHUB_REPOSITORY" --draft=false diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index ab01939fe..837387778 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -35,15 +35,8 @@ jobs: - run: npm run build - run: npm run smoke - # Bun cross-compiles all five from here (scripts/build-binary.ts), from the client built above: - # release/ompweb--.tar.gz, .zip for Windows. The x64 targets name -baseline (no AVX2 needed): in Bun 1.4.4 - # that is the default x64 runtime too (the same bytes), and naming it keeps a later Bun from shipping a -modern one. - # They keep the plain ompweb--x64 names. - name: Build the release binaries - run: | - for target in bun-linux-x64-baseline bun-linux-arm64 bun-darwin-x64-baseline bun-darwin-arm64 bun-windows-x64-baseline; do - npx bun scripts/build-binary.ts --target "$target" - done + run: sh scripts/build-release-binaries.sh - run: npm run smoke -- --binary release/ompweb-linux-x64/ompweb - name: Create draft GitHub Release diff --git a/AGENTS.md b/AGENTS.md index 98ece8130..f6896523b 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -238,6 +238,7 @@ scripts/ tailwind-plugin.ts bun-plugin-tailwind minus Tailwind's color-mix() polyfill (Bun 1.4.4 drops repeated @supports rules); build and dev smoke.ts `npm run smoke`: starts the built server (or `--binary `) and `ompweb host` with a throwaway HOME; checks the SPA, an asset, the API, a session listed through the daemon and SSE build-binary.ts `npm run build:binary`: compiles server/binary.ts (NODE_ENV define, no .env/bunfig autoload) into release/ompweb--/ beside dist/, public/, the KaTeX files, the session-edit extension and the licenses; archives it + build-release-binaries.sh the five release targets (one list), run by publish.yml and prerelease.yml (a prerelease per verified `main` commit, tagged by build time) licenses.ts the release's `licenses/`: license files of every npm package the server and client bundles hold (Bun.build metafiles; build-client.ts writes build/client-packages.json) and `bun-LICENSE-.md`, the vendored license of the embedded Bun runtime. Bumping Bun: vendor its LICENSE.md for the new version, or build-binary.ts stops dist/ build output (git-ignored, shipped in the package); the production server reads index.html and assets from here diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b7df3942..702eef348 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ All notable changes to **omp-web** (`@kahme247/ompweb`) are documented in this f - **Run sessions on other machines from one ompweb.** Link a machine (for example a MacBook) with **Settings → Hosts → Add host**, then run `ompweb host login --url ` (the token is read from stdin) and `ompweb host` there. The remote machine keeps its own `omp`, agent directory and credentials; ompweb routes. The sidebar groups sessions by host, the new-session screen has a host picker, and chat, history, notifications and resume work on every host. If the link drops, the run continues on the remote machine and the chat shows an offline banner until the host reconnects. Agents can pass `host` to `new_session` (it defaults to the agent's own host), which asks for confirmation on a remote host unless the host allows it; an agent on a remote host always asks before it starts or messages a session on this machine. Explorer, Git, worktrees and the skills, plugins, agents and MCP settings are not available on remote hosts yet. - **Restarting or redeploying ompweb no longer interrupts a run on this machine.** "This machine" now runs through a local `ompweb host` daemon, installed as a second service (`ompweb-host`) by `ompweb systemd install`, `ompweb launchd install` and the Windows tray install. The daemon keeps the omp processes; a restarted web server adopts them, with no resume prompt, and the dialogs and browser tool calls omp was waiting on come back. The daemon is required: until it is installed and linked, "This machine" shows offline (with a banner showing the install command) and new sessions there cannot start. An `ompweb` run in a terminal or with npx installs no service: keep `ompweb host` running in a second terminal. Restarting the daemon still ends runs, and `ompweb systemd restart` leaves it alone. If the web server comes back on another port, the daemon follows it. A `npm run dev` server does not take over the daemon. "This machine" can be renamed in **Settings → Hosts**. - **ompweb as a single binary, with no Node or npm.** Each release now also carries `ompweb-linux-x64`, `ompweb-linux-arm64`, `ompweb-darwin-x64`, `ompweb-darwin-arm64` (`.tar.gz`) and `ompweb-windows-x64` (`.zip`): one `ompweb` program with the web files beside it. It takes the same options and environment variables as the npm `ompweb`, and runs the daemon too (`ompweb host`). It has no tray, service installers or in-app update: the README's "Single binary" section shows the service units, and Settings → System links the release page when an update is out. Build one with `npm run build:binary`. +- **Binary prereleases from `main`.** Each commit on `main` that passes CI is published as a GitHub prerelease named after its build time (ISO 8601 UTC, tag `20261101T103000Z`) with the five single-binary archives. Prereleases are never marked latest, publish no npm package and trigger no update notice. ### Fixes & Improvements diff --git a/README.md b/README.md index ab720ac33..2efd59236 100644 --- a/README.md +++ b/README.md @@ -213,7 +213,9 @@ ompweb as one compiled program with the files it serves beside it: `ompweb-darwin-arm64.tar.gz` and `ompweb-windows-x64.zip`. It needs no Node, npm or Bun; only omp must be installed. The x64 builds use Bun's baseline runtime, so they also run on CPUs without AVX2. Each archive carries the licenses of what it -bundles in `licenses/`. +bundles in `licenses/`. Every commit on `main` that passes CI is also published as a +[prerelease](https://github.com/kahme247/ompweb/releases) named after the time it was +built (for example `2026-11-01T10:30:00Z`), with the same five archives. ```bash tar -xzf ompweb-linux-x64.tar.gz -C ~/.local/share # unpacks ompweb-linux-x64/ diff --git a/scripts/build-release-binaries.sh b/scripts/build-release-binaries.sh new file mode 100755 index 000000000..3de0fd7bb --- /dev/null +++ b/scripts/build-release-binaries.sh @@ -0,0 +1,10 @@ +#!/bin/sh +# The five binaries every release and prerelease ships (after `npm run build`), into release/: +# release/ompweb--.tar.gz, .zip for Windows. Bun cross-compiles all of them from one machine. +# The x64 targets name -baseline (no AVX2 needed): in Bun 1.4.4 that is the default x64 runtime too (the +# same bytes), and naming it keeps a later Bun from shipping a -modern one. They keep the plain +# ompweb--x64 names. +set -eu +for target in bun-linux-x64-baseline bun-linux-arm64 bun-darwin-x64-baseline bun-darwin-arm64 bun-windows-x64-baseline; do + npx bun scripts/build-binary.ts --target "$target" +done From 12412f8f05f0c9460962d209001a893d81f2d448 Mon Sep 17 00:00:00 2001 From: Andre Brait Date: Sun, 1 Nov 2026 11:09:20 +0000 Subject: [PATCH 2/2] ci(prerelease): one concurrency group per commit; tag carries the short sha --- .github/workflows/prerelease.yml | 10 ++++++---- AGENTS.md | 2 +- CHANGELOG.md | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index 5e3d0bfee..063d7c6ff 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -1,8 +1,9 @@ name: Binary prerelease # Every commit on main that passed Verify PR becomes a GitHub prerelease carrying the five single binaries, -# named after the time it was created: title 2026-11-01T10:30:00Z, tag 20261101T103000Z (git tags cannot -# hold ":"). Prereleases are never "latest", so the in-app update notice and `v*` releases are unaffected. +# titled with the time it was created (2026-11-01T10:30:00Z), tag 20261101T103000Z- (git tags +# cannot hold ":"; the sha keeps parallel runs apart). Prereleases are never "latest", so the in-app update +# notice and `v*` releases are unaffected. on: workflow_run: workflows: [Verify PR] @@ -10,8 +11,9 @@ on: branches: [main] workflow_dispatch: +# One group per commit: a shared group keeps only one pending run, so a burst of merges would drop commits. concurrency: - group: ${{ github.workflow }} + group: ${{ github.workflow }}-${{ github.event.workflow_run.head_sha || github.sha }} cancel-in-progress: false permissions: @@ -48,7 +50,7 @@ jobs: run: | now=$(date -u +%s) title=$(date -u -d "@$now" +%Y-%m-%dT%H:%M:%SZ) - tag=$(date -u -d "@$now" +%Y%m%dT%H%M%SZ) + tag=$(date -u -d "@$now" +%Y%m%dT%H%M%SZ)-$(git rev-parse --short=10 "$SHA") subject=$(git log -1 --format=%s "$SHA") # A draft first, so a failed upload never leaves a published prerelease missing archives. gh release create "$tag" release/ompweb-*.tar.gz release/ompweb-*.zip \ diff --git a/AGENTS.md b/AGENTS.md index f6896523b..7a437ef54 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -238,7 +238,7 @@ scripts/ tailwind-plugin.ts bun-plugin-tailwind minus Tailwind's color-mix() polyfill (Bun 1.4.4 drops repeated @supports rules); build and dev smoke.ts `npm run smoke`: starts the built server (or `--binary `) and `ompweb host` with a throwaway HOME; checks the SPA, an asset, the API, a session listed through the daemon and SSE build-binary.ts `npm run build:binary`: compiles server/binary.ts (NODE_ENV define, no .env/bunfig autoload) into release/ompweb--/ beside dist/, public/, the KaTeX files, the session-edit extension and the licenses; archives it - build-release-binaries.sh the five release targets (one list), run by publish.yml and prerelease.yml (a prerelease per verified `main` commit, tagged by build time) + build-release-binaries.sh the five release targets (one list), run by publish.yml and prerelease.yml (a prerelease per verified `main` commit, titled by build time; one concurrency group per commit, so no commit's run is dropped) licenses.ts the release's `licenses/`: license files of every npm package the server and client bundles hold (Bun.build metafiles; build-client.ts writes build/client-packages.json) and `bun-LICENSE-.md`, the vendored license of the embedded Bun runtime. Bumping Bun: vendor its LICENSE.md for the new version, or build-binary.ts stops dist/ build output (git-ignored, shipped in the package); the production server reads index.html and assets from here diff --git a/CHANGELOG.md b/CHANGELOG.md index 702eef348..fa37d1714 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,7 @@ All notable changes to **omp-web** (`@kahme247/ompweb`) are documented in this f - **Run sessions on other machines from one ompweb.** Link a machine (for example a MacBook) with **Settings → Hosts → Add host**, then run `ompweb host login --url ` (the token is read from stdin) and `ompweb host` there. The remote machine keeps its own `omp`, agent directory and credentials; ompweb routes. The sidebar groups sessions by host, the new-session screen has a host picker, and chat, history, notifications and resume work on every host. If the link drops, the run continues on the remote machine and the chat shows an offline banner until the host reconnects. Agents can pass `host` to `new_session` (it defaults to the agent's own host), which asks for confirmation on a remote host unless the host allows it; an agent on a remote host always asks before it starts or messages a session on this machine. Explorer, Git, worktrees and the skills, plugins, agents and MCP settings are not available on remote hosts yet. - **Restarting or redeploying ompweb no longer interrupts a run on this machine.** "This machine" now runs through a local `ompweb host` daemon, installed as a second service (`ompweb-host`) by `ompweb systemd install`, `ompweb launchd install` and the Windows tray install. The daemon keeps the omp processes; a restarted web server adopts them, with no resume prompt, and the dialogs and browser tool calls omp was waiting on come back. The daemon is required: until it is installed and linked, "This machine" shows offline (with a banner showing the install command) and new sessions there cannot start. An `ompweb` run in a terminal or with npx installs no service: keep `ompweb host` running in a second terminal. Restarting the daemon still ends runs, and `ompweb systemd restart` leaves it alone. If the web server comes back on another port, the daemon follows it. A `npm run dev` server does not take over the daemon. "This machine" can be renamed in **Settings → Hosts**. - **ompweb as a single binary, with no Node or npm.** Each release now also carries `ompweb-linux-x64`, `ompweb-linux-arm64`, `ompweb-darwin-x64`, `ompweb-darwin-arm64` (`.tar.gz`) and `ompweb-windows-x64` (`.zip`): one `ompweb` program with the web files beside it. It takes the same options and environment variables as the npm `ompweb`, and runs the daemon too (`ompweb host`). It has no tray, service installers or in-app update: the README's "Single binary" section shows the service units, and Settings → System links the release page when an update is out. Build one with `npm run build:binary`. -- **Binary prereleases from `main`.** Each commit on `main` that passes CI is published as a GitHub prerelease named after its build time (ISO 8601 UTC, tag `20261101T103000Z`) with the five single-binary archives. Prereleases are never marked latest, publish no npm package and trigger no update notice. +- **Binary prereleases from `main`.** Each commit on `main` that passes CI is published as a GitHub prerelease titled with its build time in ISO 8601 UTC (for example `2026-11-01T10:30:00Z`; tag `20261101T103000Z-`) with the five single-binary archives. Prereleases are never marked latest, publish no npm package and trigger no update notice. ### Fixes & Improvements