Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
184 commits
Select commit Hold shift + click to select a range
a0e44fc
feat(rust): establish public CLI workspace skeleton
kherembourg Nov 16, 2026
6ec98f3
feat(rust): add CLI parser module stubs
kherembourg Nov 16, 2026
13659a0
fix(rust): complete P0 workspace declarations
kherembourg Nov 16, 2026
597266c
feat(rust): add contract recorder and inventory
kherembourg Nov 16, 2026
81063b8
feat(rust): port commander cli subset
kherembourg Nov 16, 2026
18ca8a2
feat(rust): implement core primitives A
kherembourg Nov 16, 2026
e8f5c1b
chore(rust): wire wave 1 shared files
kherembourg Nov 16, 2026
6b941bf
chore(rust): declare the P1b contract modules
kherembourg Nov 16, 2026
1b1296d
chore(rust): define the Deps seam types and use macos-latest
kherembourg Nov 16, 2026
1b8944f
feat(rust): add core primitive foundations
kherembourg Nov 16, 2026
e085052
feat(rust): implement P4 core primitives
kherembourg Nov 16, 2026
a60e6f8
feat(rust): add native managed installer relaunch
kherembourg Nov 16, 2026
7f63433
fix(rust): use release target names in installers
kherembourg Nov 16, 2026
1bc0ce0
test(contract): complete native installer migration coverage
kherembourg Nov 16, 2026
0a3ff98
chore(rust): wire wave 2 shared files
kherembourg Nov 16, 2026
5abcdf6
feat(rust): add contract replay infrastructure
kherembourg Nov 16, 2026
10a556f
feat(rust): complete contract replay suite
kherembourg Nov 16, 2026
1a1f2fa
fix(contract): normalize PIDs as whole numbers and number UUIDs
kherembourg Nov 16, 2026
2ba7e95
fix(contract): keep the recorder inside the test directories
kherembourg Nov 16, 2026
1bf80e3
feat(rust): implement runtime and real host
kherembourg Nov 16, 2026
fb65854
fix(rust): refine host warnings and terminal sizing
kherembourg Nov 16, 2026
14c648a
fix(rust): remove shared state from the core tests
kherembourg Nov 16, 2026
67a301d
ci: build the binary before the contract suite and install mandoc for…
kherembourg Nov 16, 2026
73e5346
fix(rust): make the stale state lock takeover exclusive
kherembourg Nov 16, 2026
f38b3e6
fix(rust): write the lock pid without a newline, as the TS CLI
kherembourg Nov 16, 2026
b483e8f
test(rust): cover the OS lock of the stale takeover
kherembourg Nov 16, 2026
af312cf
feat(rust): give the state lock a timeout parameter
kherembourg Nov 16, 2026
d6a9bf6
feat(rust): port management command tree
kherembourg Nov 16, 2026
9b89a7b
feat(rust): port terminal games
kherembourg Nov 16, 2026
187b533
test(rust): cover terminal cleanup
kherembourg Nov 16, 2026
448f533
feat(rust): add AI plugin management
kherembourg Nov 16, 2026
53def48
fix(rust): bound AI plugin state locks
kherembourg Nov 16, 2026
679ed46
fix(rust): simplify AI updater lock result
kherembourg Nov 16, 2026
af5b6a7
feat(rust): dispatch command actions from run
kherembourg Nov 16, 2026
92a9016
fix(contract): compare snapshots by path and register extension surfaces
kherembourg Nov 16, 2026
b66321e
feat(rust): port remaining arcade games
kherembourg Nov 16, 2026
fd6f4f0
feat(rust): complete AI plugin parity
kherembourg Nov 16, 2026
3181671
feat(rust): port management requests and apply
kherembourg Nov 16, 2026
50f9047
test(contract): record P5b CLI behavior
kherembourg Nov 16, 2026
53c12bc
feat(rust): port auth usage update and doctor
kherembourg Nov 16, 2026
dfa1ba8
fix(rust): route credentials through runtime
kherembourg Nov 16, 2026
1e07077
fix(rust): resolve each credential once per run and call the daily up…
kherembourg Nov 16, 2026
bf745a3
fix(rust): keep the real keychain in the real host only
kherembourg Nov 16, 2026
887382f
test(contract): report every failing replay case
kherembourg Nov 16, 2026
d6b3b47
test(contract): map the TS temp paths and show each replay difference
kherembourg Nov 16, 2026
e3125e3
feat(rust): port the commander help format
kherembourg Nov 16, 2026
dd1ffbd
feat(rust): run the generated Management commands
kherembourg Nov 16, 2026
de91ce0
test(contract): record what the update tests really ran
kherembourg Nov 16, 2026
cf42870
fix(rust): match the TS state dir and ai plugin record writes
kherembourg Nov 16, 2026
ec6804a
fix(rust): apply refuses a redirect, as TS perform does
kherembourg Nov 16, 2026
0639009
test(contract): run the binary without the CI and agent variables
kherembourg Nov 16, 2026
011725c
feat(rust): port reference search and completion
codex Nov 16, 2026
9630f98
feat(rust): add demo mode data and command
kherembourg Nov 16, 2026
d7e58be
fix(rust): route management requests through demo mode
kherembourg Nov 16, 2026
b616e65
feat(rust): complete demo dashboard data
kherembourg Nov 16, 2026
5339879
feat(rust): port dashboard commands
kherembourg Nov 16, 2026
64ffb9d
test(rust): cover dashboard menu behavior
kherembourg Nov 16, 2026
adbfb01
test(contract): replay the demo and dashboard cases that waited for P…
kherembourg Nov 16, 2026
35b30a2
feat(rust): align dashboard demo, summary and search
kherembourg Nov 16, 2026
7220160
fix(rust): list help [command] in the dashboard group, as TS helpComm…
kherembourg Nov 16, 2026
ad1d528
feat(rust): package native release artifacts
kherembourg Nov 16, 2026
1bf1806
feat(rust): complete tree-wide command contracts
kherembourg Nov 16, 2026
2b738a7
perf(rust): parse the embedded management spec once per process
kherembourg Nov 16, 2026
bd2bd39
fix(rust): match commander in argument parsing and completion
kherembourg Nov 16, 2026
aff4e1a
fix(rust): build the reference from the full tree, extension included
kherembourg Nov 16, 2026
57f92f8
fix(rust): port the reference HTML page from TS
kherembourg Nov 16, 2026
b04b120
fix(rust): name singular sub-resources as TS
kherembourg Nov 16, 2026
4a54f52
test(contract): record the commands of extension modules
kherembourg Nov 16, 2026
9bc039d
fix(contract): normalize binary output once and keep trailing newlines
kherembourg Nov 16, 2026
1ff5abb
feat(rust): carry the system code of a network error
kherembourg Nov 16, 2026
f6383ae
test(contract): snapshot the root that holds a shared stateDir
kherembourg Nov 16, 2026
8164a30
test(contract): reference with a closed stdout and the mandoc lint
kherembourg Nov 16, 2026
74459c0
perf(rust): decode one character at a time in JSON strings
kherembourg Nov 16, 2026
e56e1d9
fix(rust): give no value for the [] default of a repeated option
kherembourg Nov 16, 2026
e98d9f6
test(contract): map TS temp paths in restored files
kherembourg Nov 16, 2026
4a0f50c
test(contract): record the steps of one setup in turn
kherembourg Nov 16, 2026
b92993a
docs: generate commands.md with scripts/gen-docs.sh
kherembourg Nov 16, 2026
71b3899
test(contract): record ext.commands only for custom modules
kherembourg Nov 16, 2026
5b4f51d
fix(contract): mask the date of a man page header, not its section
kherembourg Nov 16, 2026
f9f0933
test(contract): docs/commands.md equals the generated reference
kherembourg Nov 16, 2026
105438b
test(rust): the real transport maps the Node cause codes
kherembourg Nov 16, 2026
bd36a1c
test(contract): record the demo, dryrun and main binary cases again
kherembourg Nov 16, 2026
2eba24e
ci: install mandoc for the rust job and build darwin on macos-latest
kherembourg Nov 16, 2026
51c2b40
fix(ci): portable ai tarball fixtures and no musl rebuild in pack
kherembourg Nov 16, 2026
73d4724
fix(ci): skip the bridge window in a PR build
kherembourg Nov 16, 2026
f856db8
fix(ci): run the real bridge check only at the bridge crate version
kherembourg Nov 16, 2026
03de039
feat(contract): let the staff workspace install its replay extension
kherembourg Nov 16, 2026
9f9cfff
fix(rust): name no staff side in public files
kherembourg Nov 16, 2026
f12d606
feat(rust): port commander allowUnknownOption to the parser
kherembourg Nov 16, 2026
5af3f21
feat(rust): port helpOption(false) and a recorded terminal to the replay
kherembourg Nov 17, 2026
7f966bd
fix(rust): port the key/value fallback of TS toTable
kherembourg Nov 17, 2026
a5dbfad
fix(rust): name the option flags in the required-option error
kherembourg Nov 17, 2026
f22b944
fix(contract): replay recorded exec writes, extra roots and error names
kherembourg Nov 17, 2026
c7b3131
fix(contract): map <REPO> and fail on unmapped recording paths
kherembourg Nov 17, 2026
4d9535d
test(contract): record repo paths as <REPO>
kherembourg Nov 17, 2026
5cd9db2
fix(rust): parse a lone dash as an argument, as commander
kherembourg Nov 17, 2026
4088e16
fix(contract): drift ignores the platform and the hex of a text file
kherembourg Nov 17, 2026
d260584
fix(contract): replay the case files in one sorted order
kherembourg Nov 17, 2026
6d1549c
fix(contract): drift compares a recorded temp root by its token
kherembourg Nov 17, 2026
39ae3d4
test(contract): the drift check reports every drifting case
kherembourg Nov 17, 2026
5b2e8df
test(contract): name no staff side in the drift test
kherembourg Nov 17, 2026
719b9e2
test(contract): report a drift as the JSON paths that differ
kherembourg Nov 17, 2026
ac85b2f
fix(contract): drift skips unit cases and ignores reply bytes and wall
kherembourg Nov 17, 2026
de72cd2
fix(contract): write recorded exec files under the folder of this run
kherembourg Nov 17, 2026
08acd45
test(contract): record the terminal of d.io and replay a resize
kherembourg Nov 17, 2026
857f7f1
fix(rust): put summary first in the dashboard menu
kherembourg Nov 17, 2026
2bae4b8
fix(rust): refuse group options before the subcommand
kherembourg Nov 17, 2026
8d5e64f
test(contract): record the dashboard-menu and games cases
kherembourg Nov 17, 2026
f92ef84
test(contract): give the install and release cases the case file shape
kherembourg Nov 17, 2026
d10f843
test(rust): check the brand nav, the index and the anchors of the htm…
kherembourg Nov 17, 2026
738b437
test(contract): check the inventory against the real test list
kherembourg Nov 17, 2026
3da647a
test(contract): map the command generation tests to the spec tests
kherembourg Nov 17, 2026
faa037a
test(rust): port the two request building unit tests
kherembourg Nov 17, 2026
844f3e5
test(rust): port the two reference tree tests
kherembourg Nov 17, 2026
3bb7411
test(contract): map the plumbing tests to their Rust ports
kherembourg Nov 17, 2026
7d0272d
test(rust): port the two state lock tests
kherembourg Nov 17, 2026
19c2f36
test(rust): port the limiter tests
kherembourg Nov 17, 2026
f631c31
test(rust): port the install kind, newer, notice and detach tests
kherembourg Nov 17, 2026
d3c4dc3
fix(rust): make a stdout error other than EPIPE fatal
kherembourg Nov 17, 2026
3990988
test(rust): port the plugin spawn, demo, sparkline and dashboard spec…
kherembourg Nov 17, 2026
bca7556
test(contract): port the doc checks to Rust
kherembourg Nov 17, 2026
2854cd2
fix(rust): start invaders, minesweeper and tetris from games
kherembourg Nov 17, 2026
10b52f1
fix(rust): pass a typed space to a menu and quit a game on Shift+Q
kherembourg Nov 17, 2026
ee39563
test(contract): map the game and menu tests to their Rust ports
kherembourg Nov 17, 2026
77bd267
test(contract): require zero unmapped inventory IDs
kherembourg Nov 17, 2026
8ff0534
test(rust): fix two clippy findings in the new tests
kherembourg Nov 17, 2026
6f011e4
test(rust): run the play loop on a pseudo-terminal
kherembourg Nov 17, 2026
7fb7bb0
fix(contract): drift reads the committed cases from the workspace root
kherembourg Nov 17, 2026
88ac93e
fix(contract): real drift checks for the public cases
kherembourg Nov 17, 2026
8d17b95
fix(contract): pair renamed folders from the end; mask the Node version
kherembourg Nov 17, 2026
8c171d1
build(release): read the version from Cargo.toml and the host from pa…
kherembourg Nov 17, 2026
ce1fd79
test(contract): delete the drift job and the test-ID inventory
kherembourg Nov 17, 2026
234099b
chore: delete the TypeScript CLI and its Node CI job
kherembourg Nov 17, 2026
07b9c29
docs: describe the Rust workflow and CONTRACT_BLESS after the cut-over
kherembourg Nov 17, 2026
351886e
fix(contract): bless rewrites only the case files it changes
kherembourg Nov 17, 2026
d032dc1
docs: how to update a blessed case; why Node stays for the bridge check
kherembourg Nov 17, 2026
cf2efb0
ci: clippy the whole workspace with all targets, as the docs say
kherembourg Nov 17, 2026
bce8989
fix(state): return a failed state write from release and record, as TS
kherembourg Nov 17, 2026
9cdbeb9
test(contract): CONTRACT_ORDER=reverse replays the case files last to…
kherembourg Nov 17, 2026
99148bf
docs: drop the Node wording of the install host, install kind and bin…
kherembourg Nov 17, 2026
185872e
chore(contract): remove base64, sha2 and record_path, which nothing uses
kherembourg Nov 17, 2026
f0a98d6
fix(update): give no notice when the notified_at write fails, as TS
kherembourg Nov 17, 2026
977965c
fix(term): clean turns each run of control characters into one space,…
kherembourg Nov 17, 2026
d0e0b3e
feat(http): a rate_limited hook reads a rate limit from the body, as TS
kherembourg Nov 17, 2026
de9ca5c
fix(json): keep lone surrogates as JS code units, in keys too
kherembourg Nov 17, 2026
9176c62
fix(tls): extra CA certificates extend the Mozilla roots instead of r…
kherembourg Nov 17, 2026
56330c5
fix(output): an --out or spill write failure is an error with a nonze…
kherembourg Nov 17, 2026
ec19c7d
fix(apply): an allowlist refusal after a write is a partial failure (…
kherembourg Nov 17, 2026
ab8c313
fix(ai): check every payload destination, keep state in dry-run refus…
kherembourg Nov 18, 2026
8f4722a
fix(ci): give the publish job its repository and ship the published v…
kherembourg Nov 18, 2026
42a3b53
test(contract): the fake host keeps header multiplicity, so a duplica…
kherembourg Nov 18, 2026
2494769
fix(contract): replace UUIDs before the pid in the normalizer
kherembourg Nov 18, 2026
2831a2b
fix(http): ignore proxy variables as Node fetch did, and reuse one ag…
kherembourg Nov 18, 2026
1cd74b4
fix(cli): parse as commander 15: bare program help, last value wins, …
kherembourg Nov 18, 2026
fe40aa9
fix(update): newer as TS Number() parts, and the latest merge under t…
kherembourg Nov 18, 2026
02f0b6d
refactor(ai): no replay tar fallback in the binary; the release folde…
kherembourg Nov 18, 2026
0728315
fix(install): semver_js order in is_newer, stale-lock check and trap …
kherembourg Nov 18, 2026
920769d
fix(ci): set SHELL for the frozen installer in the bridge acceptance …
kherembourg Nov 18, 2026
58bcacf
test(ci): one commit per action and version in the workflow pins
kherembourg Nov 18, 2026
ba47625
fix(ci): add the per-page release counts of gh api --paginate
kherembourg Nov 18, 2026
24e46a7
fix(pack): CommonJS bridge under a module package.json, bridge refere…
kherembourg Nov 18, 2026
fa6cc7c
fix(cli): commands made after enablePositionalOptions inherit it, as …
kherembourg Nov 18, 2026
11f523e
test(contract): harness steps run --version, not a bare program (whic…
kherembourg Nov 18, 2026
94c58d4
ci: pin setup-zig to the v2.2.1 commit
kherembourg Nov 18, 2026
6f129c4
fix(release): set the bridge version 0.9.0 and check the relaunch wit…
kherembourg Nov 18, 2026
879f42c
fix(core): empty XDG variables fall back to the home directories
kherembourg Nov 18, 2026
68fc4c2
fix(core): decode a non-UTF-8 environment or argument as Node does
kherembourg Nov 18, 2026
b9290fd
fix(management): check the write allowlist on the pathname that fetch…
kherembourg Nov 18, 2026
3060c70
fix(api): read stdin for - only, encode non-ASCII paths, keep the met…
kherembourg Nov 18, 2026
7a3f47f
fix(apply): refuse a non-string confirm, keep --output and --out
kherembourg Nov 18, 2026
1326253
fix(update): emit the result with the parsed --output and --out
kherembourg Nov 18, 2026
0724df1
fix(output): size and cut table cells in UTF-16 code units as JS does
kherembourg Nov 18, 2026
d1d1e22
fix(exec): start the timeout at spawn and write stdin in its own thread
kherembourg Nov 18, 2026
cf06ac1
fix(ai): refuse a plugin release whose skills cannot be listed
kherembourg Nov 18, 2026
0c0cf8c
fix(ai): an explicit update reports a failed plugin lookup or state w…
kherembourg Nov 18, 2026
ed022dc
fix(ai): keep the registration when a plugin dir cannot be removed
kherembourg Nov 18, 2026
7b2da1f
fix(contract): replay the timedOut field of a recorded exec result
kherembourg Nov 18, 2026
c8d574e
fix(release): rerun a published release safely and add the reinstall …
kherembourg Nov 18, 2026
ad7b8b0
fix(exec): bound the pipe teardown after a timeout
kherembourg Nov 18, 2026
5a9155b
fix(ai): keep the ownership marker when an uninstall fails
kherembourg Nov 18, 2026
89344e0
fix(api): send the serialized URL of the checked path
kherembourg Nov 18, 2026
a1b7685
fix(apply): check and show the destination after normalisation
kherembourg Nov 18, 2026
d5b83f3
fix(release): verify window reruns, publish drafts and keep channels …
kherembourg Nov 18, 2026
6d3853f
fix(release): check the newest release again in the deploy and formul…
kherembourg Nov 18, 2026
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
11 changes: 0 additions & 11 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
version: 2
updates:
- package-ecosystem: npm
directory: /
schedule:
interval: weekly
groups:
dev:
dependency-type: development
ignore:
# The types follow the oldest Node in engines, so a call to a newer API fails the typecheck.
- dependency-name: "@types/node"
update-types: ["version-update:semver-major"]
- package-ecosystem: github-actions
directory: /
schedule:
Expand Down
214 changes: 214 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,214 @@
name: Build

on:
pull_request:
workflow_call:
inputs:
version:
required: true
type: string
native_release_count:
required: false
type: string
default: '0'

permissions:
contents: read

jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- target: darwin-arm64
triple: aarch64-apple-darwin
arch: arm64
runner: macos-latest
- target: darwin-x64
triple: x86_64-apple-darwin
arch: x86_64
runner: macos-latest
- target: linux-x64
triple: x86_64-unknown-linux-musl
arch: x86-64
runner: ubuntu-latest
- target: linux-arm64
triple: aarch64-unknown-linux-musl
arch: aarch64
runner: ubuntu-latest
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: dtolnay/rust-toolchain@d1031067263f94b142dd6c0ce24c5eb9d02d52a0
with:
toolchain: 1.99.1
targets: ${{ matrix.triple }}
- if: startsWith(matrix.target, 'linux-')
uses: mlugg/setup-zig@d1434d08867e3ee9daa34448df10607b98908d29 # v2.2.1
- if: startsWith(matrix.target, 'linux-')
run: cargo install cargo-zigbuild --locked
- name: Build binary
shell: bash
run: |
if [[ '${{ matrix.target }}' == linux-* ]]; then
cargo zigbuild --release -p purchasely --bin purchasely --target '${{ matrix.triple }}'
else
cargo build --release -p purchasely --bin purchasely --target '${{ matrix.triple }}'
fi
mkdir -p "out/${{ matrix.target }}"
cp "target/${{ matrix.triple }}/release/purchasely" "out/${{ matrix.target }}/purchasely"
- name: Sign and verify macOS binary
if: startsWith(matrix.target, 'darwin-')
shell: bash
run: |
strip "out/${{ matrix.target }}/purchasely"
if [[ '${{ matrix.target }}' == darwin-x64 ]]; then codesign -s - -f "out/${{ matrix.target }}/purchasely"; fi
codesign -v "out/${{ matrix.target }}/purchasely"
- name: Check binary architecture
run: file "out/${{ matrix.target }}/purchasely" | grep -F '${{ matrix.arch }}'
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: binary-${{ matrix.target }}
path: out/${{ matrix.target }}/purchasely
if-no-files-found: error

smoke:
needs: build
strategy:
fail-fast: false
matrix:
include:
- target: darwin-arm64
runner: macos-latest
- target: darwin-x64
runner: macos-latest
- target: linux-x64
runner: ubuntu-latest
- target: linux-arm64
runner: ubuntu-24.04-arm
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: binary-${{ matrix.target }}
path: out
- name: Smoke target binary
env:
VERSION: ${{ inputs.version }}
shell: bash
run: |
if [[ '${{ matrix.target }}' == darwin-x64 ]] && ! arch -x86_64 /usr/bin/true 2>/dev/null; then
echo 'Rosetta unavailable; skipping darwin-x64 runtime smoke'
else
chmod +x out/purchasely
actual=$(PURCHASELY_DISABLE_AUTOUPDATE=1 ./out/purchasely --version)
echo "$actual"
test -n "$actual"
if [ -n "$VERSION" ]; then test "$actual" = "$VERSION"; fi
fi

pack:
needs: [build, smoke]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: dtolnay/rust-toolchain@d1031067263f94b142dd6c0ce24c5eb9d02d52a0
with:
toolchain: 1.99.1
targets: x86_64-unknown-linux-musl
- run: sudo apt-get update && sudo apt-get install -y mandoc
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
pattern: binary-*
path: out/bins
merge-multiple: false
- name: Arrange target binaries
env:
GH_TOKEN: ${{ github.token }}
run: |
mkdir -p target/release-bins
for target in darwin-arm64 darwin-x64 linux-arm64 linux-x64; do
mkdir -p "target/release-bins/$target"
cp "out/bins/binary-$target/purchasely" "target/release-bins/$target/purchasely"
done
# Artifacts lose the executable bit. The linux-x64 binary also generates the reference.
- name: Make the binaries executable
run: chmod +x target/release-bins/*/purchasely
- name: Pack release and bridge
env:
GH_TOKEN: ${{ github.token }}
P12B_BIN_DIR: target/release-bins
P12B_REFERENCE_BIN: target/release-bins/linux-x64/purchasely
VERSION: ${{ inputs.version }}
PREVIOUS_NATIVE_RELEASES: ${{ inputs.native_release_count }}
run: |
bridge_releases=$(sed -n 's/^BRIDGE_RELEASES=//p' packaging/bridge.env)
version="$VERSION"
if [ -z "$version" ]; then version="$(grep '^version =' crates/purchasely/Cargo.toml | head -1 | cut -d'"' -f2)"; fi
sh scripts/pack-release.sh --version "$version" out/native
sh scripts/pack-release.sh --bridge --version 0.9.0 out/bridge
bridge_bytes=$(wc -c < out/bridge/purchasely-0.9.0.tgz)
test "$bridge_bytes" -le 25165824
# A PR build has no VERSION: it packs only, the bridge window needs the published v0.9.0.
if [ -n "$VERSION" ] && [ "$version" != 0.9.0 ] && [ "$((${PREVIOUS_NATIVE_RELEASES:-0} + 1))" -le "$bridge_releases" ]; then
# out/bridge holds the bridge packed above: the window ships the published, immutable asset.
published="$RUNNER_TEMP/published-bridge"
rm -rf "$published"
gh release download v0.9.0 -p purchasely-0.9.0.tgz -D "$published"
count=$((PREVIOUS_NATIVE_RELEASES + 1))
P12B_BRIDGE_ARCHIVE="$published/purchasely-0.9.0.tgz" sh scripts/pack-release.sh --version "$version" --native "$version" --native-release-count "$count" out/window
# The window pack is a whole native pack plus the bridge: it replaces out/native (both hold assets/).
rm -rf out/native
mv out/window out/native
fi
- name: Verify bridge with the frozen installer and real binaries
if: inputs.version == '0.9.0' || inputs.version == ''
run: |
# Node stays for this check only: the frozen old installer (install.sh of the Node CLI, before the bridge)
# runs node, as on an old managed install that the bridge must upgrade. It needs Node 22.12 or newer from
# the runner image.
# The bridge runs the native binary, which prints its crate version; the old installer wants 0.9.0.
# Before the crate is 0.9.0, the test release::bridge_tgz_accepted_by_old_installer covers this with fakes.
crate=$(grep '^version =' crates/purchasely/Cargo.toml | head -1 | cut -d'"' -f2)
if [ "$crate" != 0.9.0 ]; then echo "skip: crate version $crate is not the bridge version 0.9.0"; exit 0; fi
mkdir -p out/old-site "$RUNNER_TEMP/bridge-home" "$RUNNER_TEMP/bridge-root" "$RUNNER_TEMP/bridge-bin"
cp out/bridge/purchasely-0.9.0.tgz out/bridge/latest.json out/bridge/SHA256SUMS out/old-site/
sed 's|^HOST=$|HOST=https://cli.test|' crates/contract/tests/fixtures/old-install.sh > "$RUNNER_TEMP/old-install.sh"
cat > "$RUNNER_TEMP/bridge-bin/curl" <<'CURL'
#!/bin/sh
out=; prev=; url=
for a in "$@"; do [ "$prev" = -o ] && out=$a; prev=$a; url=$a; done
cp "$FAKE_SITE/${url##*/}" "$out"
CURL
chmod +x "$RUNNER_TEMP/bridge-bin/curl"
# The frozen installer reads SHELL under set -u, and a runner may not export it (dash does not set it).
SHELL="${SHELL:-/bin/sh}" PATH="$RUNNER_TEMP/bridge-bin:$PATH" HOME="$RUNNER_TEMP/bridge-home" XDG_DATA_HOME="$RUNNER_TEMP/bridge-home/xdg" TMPDIR="$RUNNER_TEMP" FAKE_SITE="$PWD/out/old-site" sh "$RUNNER_TEMP/old-install.sh" --version 0.9.0 --root "$RUNNER_TEMP/bridge-root"
test "$(cat "$RUNNER_TEMP/bridge-root/current-version")" = 0.9.0
# The first start goes through the Node launcher of the old installer: the shim writes the native launcher.
launcher="$RUNNER_TEMP/bridge-root/bin/purchasely"
grep -q 'exec node' "$launcher"
run_launcher() { HOME="$RUNNER_TEMP/bridge-home" XDG_CONFIG_HOME="$RUNNER_TEMP/bridge-home/config" XDG_STATE_HOME="$RUNNER_TEMP/bridge-home/state" XDG_CACHE_HOME="$RUNNER_TEMP/bridge-home/cache" TMPDIR="$RUNNER_TEMP" PURCHASELY_DISABLE_AUTOUPDATE=1 "$launcher" --version; }
test "$(run_launcher)" = 0.9.0
! grep -q node "$launcher"
# The next start runs the native binary with no Node on PATH.
nodeless=$(printf '%s\n' "$PATH" | tr ':' '\n' | while read -r d; do [ -x "$d/node" ] || printf '%s:' "$d"; done)
test "$(PATH="$nodeless" sh -c 'command -v node' || true)" = ""
test "$(PATH="$nodeless" run_launcher)" = 0.9.0
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
if: inputs.version != '0.9.0'
with:
name: release-files
path: out/native/*
if-no-files-found: error
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
if: inputs.version == '0.9.0'
with:
name: release-files
path: out/bridge/*
if-no-files-found: error
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: legacy-bridge
path: out/bridge/purchasely-0.9.0.tgz
if-no-files-found: error
26 changes: 16 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,24 @@ permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest
rust:
strategy:
matrix:
node: [22, 24]
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
- uses: dtolnay/rust-toolchain@d1031067263f94b142dd6c0ce24c5eb9d02d52a0
with:
node-version: ${{ matrix.node }}
cache: npm
- run: sudo apt-get update && sudo apt-get install -y mandoc
- run: npm ci
- run: npm run typecheck
- run: npm test
toolchain: 1.99.1
components: rustfmt, clippy
- run: cargo fmt --check
- run: cargo clippy --workspace --all-targets -- -D warnings
# The man page lint test needs mandoc; macOS ships it in /usr/bin.
- if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y mandoc
# The binary contract suite runs target/debug/purchasely: build it first.
- run: cargo build -p purchasely --bins
# release::bridge_tgz_accepted_by_old_installer runs the frozen installer of the Node CLI (before the bridge),
# which needs Node 22.12 or newer from the runner image (`which node`). The CLI itself needs no Node.
- run: cargo test --workspace
Loading
Loading