Skip to content
Open
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
97 changes: 0 additions & 97 deletions .github/workflows/omp-runner.yml

This file was deleted.

23 changes: 8 additions & 15 deletions .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,25 +39,18 @@ jobs:
cache: npm

- run: npm ci
- run: npm run build
# The omp the runners compile against: the fork's newest integration build, not runner/omp-build.json's pin
# (not committed back). No such release or a runner that fails tsc against it fails the release.
- name: Find the newest omp integration build
# The omp runner every binary bundles and records: the newest published release of the fork (ompweb-dev/oh-my-pi,
# which builds and releases it) that attaches every platform's runner and whose ompweb-omp.json names this ompweb's
# RUNNER_PROTOCOL, written into omp-runner.json here (the binaries bake it in; not committed back). None fails the
# release. The build below downloads each platform's runner (SHA-256-checked) from it.
- name: Pin the newest omp runner of the fork
env:
GH_TOKEN: ${{ github.token }}
run: |
set -euo pipefail
sha=$(gh api repos/ompweb-dev/oh-my-pi/commits/integration-release --jq .sha)
tag=$(gh api --paginate 'repos/ompweb-dev/oh-my-pi/releases?per_page=100' --jq '.[].tag_name' \
| grep -E "^v[0-9]+\.[0-9]+\.[0-9]+-int\.[0-9]{12}\.g${sha:0:7}\$" | head -n 1 || true)
if [ -z "$tag" ]; then
echo "::error::ompweb-dev/oh-my-pi has no integration release for integration-release ($sha)"
exit 1
fi
echo "OMP_TAG=$tag" >> "$GITHUB_ENV"
# Without GH_TOKEN: bun install runs the omp packages' scripts.
- name: Pin the runner to it
run: npx bun runner/scripts/use-omp-build.ts "$OMP_TAG" && (cd runner && npx bun x tsc -p .)
npx bun scripts/fetch-runner.ts --latest linux-x64
echo "OMP_TAG=$(node -p 'require("./omp-runner.json").tag')" >> "$GITHUB_ENV"
- run: npm run build
- name: Pin the binary release identity
run: |
now=$(date -u +%s)
Expand Down
40 changes: 12 additions & 28 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,25 +34,17 @@ jobs:

- run: npm install --global npm@^11.5.1
- run: npm ci
# The omp the runners compile against: the fork's newest integration build, not runner/omp-build.json's pin
# (not committed back). No such release or a runner that fails tsc against it fails the release. Pinned before
# the tests: they import the runner (lib/hosts/omp-socket.test.mjs), and must run against the omp that ships.
- name: Find the newest omp integration build
# The omp runner this release ships against and records: the newest published release of the fork (ompweb-dev/oh-my-pi,
# which builds and releases it) that attaches every platform's runner and whose ompweb-omp.json names this ompweb's
# RUNNER_PROTOCOL, written into omp-runner.json here (the npm package and the binaries bake it in; not committed back).
# None fails the release. Pinned before the tests and builds so everything runs against the runner that ships.
- name: Pin the newest omp runner of the fork
env:
GH_TOKEN: ${{ github.token }}
run: |
set -euo pipefail
sha=$(gh api repos/ompweb-dev/oh-my-pi/commits/integration-release --jq .sha)
tag=$(gh api --paginate 'repos/ompweb-dev/oh-my-pi/releases?per_page=100' --jq '.[].tag_name' \
| grep -E "^v[0-9]+\.[0-9]+\.[0-9]+-int\.[0-9]{12}\.g${sha:0:7}\$" | head -n 1 || true)
if [ -z "$tag" ]; then
echo "::error::ompweb-dev/oh-my-pi has no integration release for integration-release ($sha)"
exit 1
fi
echo "OMP_TAG=$tag" >> "$GITHUB_ENV"
# Without GH_TOKEN: bun install runs the omp packages' scripts.
- name: Pin the runner to it
run: npx bun runner/scripts/use-omp-build.ts "$OMP_TAG" && (cd runner && npx bun x tsc -p .)
npx bun scripts/fetch-runner.ts --latest linux-x64
echo "OMP_TAG=$(node -p 'require("./omp-runner.json").tag')" >> "$GITHUB_ENV"
# Match Verify PR: allow isolated fixtures, never control of the runner's service.
- name: Allow isolated native fixture scopes
run: |
Expand All @@ -61,13 +53,11 @@ jobs:
systemd-run --scope --quiet --collect --no-ask-password true
- run: npm test
- run: npm run build
# Builds the omp runners too, which the source smoke spawns from runner/release/. The archives leave them out:
# every install fetches its runner from this release (lib/omp/runner-fetch.ts), attached below.
# The archives leave the runner out: every install fetches it from the pinned fork release (lib/omp/runner-fetch.ts).
- name: Build the release binaries
run: sh scripts/build-release-binaries.sh --no-runner
- run: npm run smoke
# --omp: the draft release cannot serve the runner to the binary yet.
- run: npm run smoke -- --binary release/ompweb-linux-x64/ompweb --omp runner/release/ompweb-omp-linux-x64
- run: npm run smoke -- --binary release/ompweb-linux-x64/ompweb

- name: Create draft GitHub Release
env:
Expand All @@ -79,18 +69,12 @@ jobs:
gh release create "$TAG" --repo "$GITHUB_REPOSITORY" --verify-tag --title "$TAG" --notes-file release-notes.md --draft
fi

# The runners, by the names and checksum listing lib/omp/runner-fetch.ts fetches (OMP_RUNNER_ASSET,
# OMP_RUNNER_CHECKSUMS), for binary and npm installs alike.
- name: Attach the binaries and the omp runners to the draft release
- name: Attach the binaries to the draft release
env:
GH_TOKEN: ${{ github.token }}
run: |
set -euo pipefail
runners=(ompweb-omp-linux-x64 ompweb-omp-linux-arm64 ompweb-omp-darwin-x64 ompweb-omp-darwin-arm64 ompweb-omp-windows-x64.exe)
(cd runner/release && sha256sum "${runners[@]}" > ompweb-omp.sha256)
gh release upload "$TAG" release/ompweb-*.tar.gz release/ompweb-*.zip "${runners[@]/#/runner/release/}" runner/release/ompweb-omp.sha256 --repo "$GITHUB_REPOSITORY" --clobber
run: gh release upload "$TAG" release/ompweb-*.tar.gz release/ompweb-*.zip --repo "$GITHUB_REPOSITORY" --clobber

# Before npm: an npm install fetches its runner from this release, which a draft does not serve.
# Before npm: a draft serves no archives, which the in-app update notice and host updates download.
- name: Publish GitHub Release
env:
GH_TOKEN: ${{ github.token }}
Expand Down
19 changes: 9 additions & 10 deletions .github/workflows/verify-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,8 @@ jobs:
node-version-file: .nvmrc
cache: npm

# The runner's own deps too: lib/hosts/omp-socket.test.mjs checks the host against runner/src/channel.ts.
- name: Install dependencies
run: |
npm ci
npx bun runner/scripts/use-omp-build.ts
npx bun install --cwd runner --frozen-lockfile
run: npm ci

- name: TypeScript typecheck
run: npm run typecheck
Expand Down Expand Up @@ -86,8 +82,10 @@ jobs:
- name: Verify production build
run: npm run build

- name: Build the omp runner
run: npx bun runner/scripts/build-binary.ts
# The omp runner is built and released by the oh-my-pi fork: this downloads the release omp-runner.json pins
# (SHA-256-checked) into release/runners/, where the smoke tests, the binary build and the upgrade test find it.
- name: Fetch the pinned omp runner
run: npx bun scripts/fetch-runner.ts

- name: Smoke test
run: npm run smoke
Expand Down Expand Up @@ -127,22 +125,23 @@ jobs:
env:
OMPWEB_COMPILED_UPGRADE_E2E: "1"
run: |
export OMPWEB_UPGRADE_E2E_RUNNER="$(node -p "require('node:path').resolve('runner', 'release', 'ompweb-omp-' + (process.platform === 'win32' ? 'windows' : process.platform) + '-' + process.arch + (process.platform === 'win32' ? '.exe' : ''))")"
OMPWEB_UPGRADE_E2E_RUNNER="$(npx bun scripts/fetch-runner.ts)"
export OMPWEB_UPGRADE_E2E_RUNNER
npx bun test --parallel --timeout 900000 lib/compiled-upgrade.integration.test.mjs

- name: Packed install smoke test
shell: bash
run: |
npm pack --ignore-scripts
npm install -g --prefix "$RUNNER_TEMP/ompweb-prefix" ./kahme247-ompweb-*.tgz
npm run smoke -- --omp "$(ls runner/release/ompweb-omp-*)" --package "$(npm root -g --prefix "$RUNNER_TEMP/ompweb-prefix")/@kahme247/ompweb"
npm run smoke -- --package "$(npm root -g --prefix "$RUNNER_TEMP/ompweb-prefix")/@kahme247/ompweb"

# Bun's postinstall does not run here: the launcher must fall back to @oven/bun-<os>-<arch> (spec R1).
- name: Packed install smoke test (install scripts disabled)
shell: bash
run: |
npm install -g --ignore-scripts --prefix "$RUNNER_TEMP/ompweb-prefix-no-scripts" ./kahme247-ompweb-*.tgz
npm run smoke -- --omp "$(ls runner/release/ompweb-omp-*)" --package "$(npm root -g --prefix "$RUNNER_TEMP/ompweb-prefix-no-scripts")/@kahme247/ompweb"
npm run smoke -- --package "$(npm root -g --prefix "$RUNNER_TEMP/ompweb-prefix-no-scripts")/@kahme247/ompweb"

- name: Parse Windows PowerShell scripts (Windows only)
if: runner.os == 'Windows'
Expand Down
Loading