Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
166 commits
Select commit Hold shift + click to select a range
8e0e71f
feat(truapi): add testing API and versioned wiring
pgherveou Jun 30, 2026
dea080a
fixup! feat(truapi): add testing API and versioned wiring
pgherveou Jul 1, 2026
3409152
fixup! feat(truapi): add testing API and versioned wiring
pgherveou Jul 1, 2026
0569aaf
fixup! feat(truapi): add testing API and versioned wiring
pgherveou Jul 2, 2026
8c93e99
feat(truapi-platform): add host capability traits
pgherveou Jun 30, 2026
97d0b79
fixup! feat(truapi-platform): add host capability traits
pgherveou Jul 2, 2026
d2e3674
fixup! feat(truapi-platform): add host capability traits
pgherveou Jul 3, 2026
c6f888c
feat(truapi-codegen): emit Rust dispatcher, wire table, and host call…
pgherveou Jun 30, 2026
a37abae
fixup! feat(truapi-codegen): emit Rust dispatcher, wire table, and ho…
pgherveou Jul 2, 2026
99d1b7e
fixup! feat(truapi-codegen): emit Rust dispatcher, wire table, and ho…
pgherveou Jul 2, 2026
1c46353
fixup! feat(truapi-codegen): emit Rust dispatcher, wire table, and ho…
pgherveou Jul 2, 2026
2c52262
fixup! feat(truapi-codegen): emit Rust dispatcher, wire table, and ho…
pgherveou Jul 3, 2026
7bd57b8
fixup! feat(truapi-codegen): emit Rust dispatcher, wire table, and ho…
pgherveou Jul 3, 2026
6964df3
feat(truapi-server): add host logic primitives
pgherveou Jul 1, 2026
c8c4595
fixup! feat(truapi-server): add host logic primitives
pgherveou Jul 1, 2026
88cf1a9
fixup! feat(truapi-server): add host logic primitives
pgherveou Jul 2, 2026
2d88bdf
fixup! feat(truapi-server): add host logic primitives
pgherveou Jul 3, 2026
e1f6790
feat(truapi-server): add wire and chain infrastructure
pgherveou Jul 1, 2026
d959726
fixup! feat(truapi-server): add wire and chain infrastructure
pgherveou Jul 3, 2026
fa642c1
fixup! feat(truapi-server): add host logic primitives
pgherveou Jul 3, 2026
176c6b1
feat(truapi-server): add platform runtime and host bridge
pgherveou Jul 1, 2026
6aa9887
fixup! feat(truapi-server): add platform runtime and host bridge
pgherveou Jul 1, 2026
0f6e16c
fixup! feat(truapi-server): add platform runtime and host bridge
pgherveou Jul 2, 2026
80ff2c7
fixup! feat(truapi-server): add platform runtime and host bridge
pgherveou Jul 2, 2026
c6091f0
fixup! feat(truapi-server): add platform runtime and host bridge
pgherveou Jul 3, 2026
e4d9a0d
fixup! feat(truapi-server): add wire and chain infrastructure
pgherveou Jul 3, 2026
302e84c
feat(host-wasm): add @parity/truapi-host-wasm runtime
pgherveou Jun 30, 2026
63f59f9
fixup! feat(host-wasm): add @parity/truapi-host-wasm runtime
pgherveou Jul 1, 2026
cda98b6
chore: docs, CI, tooling, and dotli integration for the Rust core
pgherveou Jun 30, 2026
232458b
fixup! feat(host-wasm): add @parity/truapi-host-wasm runtime
pgherveou Jul 2, 2026
375c395
fixup! chore: docs, CI, tooling, and dotli integration for the Rust core
pgherveou Jul 1, 2026
7ac562a
fixup! feat(truapi-server): add platform runtime and host bridge
pgherveou Jul 3, 2026
e33df7c
fixup! feat(host-wasm): add @parity/truapi-host-wasm runtime
pgherveou Jul 3, 2026
518d270
fixup! chore: docs, CI, tooling, and dotli integration for the Rust core
pgherveou Jul 2, 2026
dab5395
Merge origin/main into rust-core/04-codegen
pgherveou Jul 3, 2026
15e1594
Merge branch 'rust-core/04-codegen' into rust-core/04a-server-host-logic
pgherveou Jul 3, 2026
54f0b20
docs(host-logic): link host-spec sections
pgherveou Jul 3, 2026
2da3da5
Merge branch 'rust-core/04a-server-host-logic' into rust-core/04b-ser…
pgherveou Jul 3, 2026
f7b2424
Merge branch 'rust-core/04b-server-wire-chain' into rust-core/03-serv…
pgherveou Jul 3, 2026
ac7992f
docs(runtime): link host-spec sections
pgherveou Jul 3, 2026
cd15f9c
Merge branch 'rust-core/03-server-runtime' into rust-core/05-host-wasm
pgherveou Jul 3, 2026
67d763b
docs(server): fix wasm rustdoc reference
pgherveou Jul 3, 2026
351f6e7
Merge branch 'rust-core/05-host-wasm' into rust-core/06-docs-ci-tooling
pgherveou Jul 3, 2026
e058ba3
chore(dotli): update truapi integration sha
pgherveou Jul 3, 2026
cda27e1
fixup! feat(truapi-server): add wire and chain infrastructure
pgherveou Jul 3, 2026
227f47c
Merge branch 'rust-core/04b-server-wire-chain' into rust-core/03-serv…
pgherveou Jul 3, 2026
8bd9085
fixup! feat(truapi-server): add platform runtime and host bridge
pgherveou Jul 3, 2026
51f1e1c
Merge branch 'rust-core/03-server-runtime' into rust-core/05-host-wasm
pgherveou Jul 3, 2026
312be68
Merge branch 'rust-core/05-host-wasm' into rust-core/06-docs-ci-tooling
pgherveou Jul 3, 2026
ba2571a
Merge branch 'main' into rust-core/03-server-runtime
pgherveou Jul 3, 2026
b804d04
fix(server): enforce runtime permissions
pgherveou Jul 6, 2026
f22b4b5
feat(codegen): generate wasm bridge callbacks
pgherveou Jul 6, 2026
2cb1e97
Merge branch 'rust-core/04-wasm-bridge-codegen' into rust-core/05-hos…
pgherveou Jul 6, 2026
4c04dd3
refactor(host-wasm): use namespaced callbacks
pgherveou Jul 6, 2026
fa859e3
Merge branch 'rust-core/05-host-wasm' into rust-core/06-docs-ci-tooling
pgherveou Jul 6, 2026
23bb0b8
chore(dotli): update host integration
pgherveou Jul 6, 2026
5de806e
fix(server): include runtime crate in workspace
pgherveou Jul 6, 2026
460dc77
Merge branch 'rust-core/03-server-runtime' into rust-core/04-wasm-bri…
pgherveou Jul 6, 2026
e9888aa
Merge branch 'rust-core/04-wasm-bridge-codegen' into rust-core/05-hos…
pgherveou Jul 6, 2026
d820bb0
Merge branch 'rust-core/05-host-wasm' into rust-core/06-docs-ci-tooling
pgherveou Jul 6, 2026
0d304f8
docs(server): describe permission flow
pgherveou Jul 6, 2026
cddce3e
Merge branch 'rust-core/03-server-runtime' into rust-core/04-wasm-bri…
pgherveou Jul 6, 2026
b4ac06f
Merge branch 'rust-core/04-wasm-bridge-codegen' into rust-core/05-hos…
pgherveou Jul 6, 2026
307e08f
Merge branch 'rust-core/05-host-wasm' into rust-core/06-docs-ci-tooling
pgherveou Jul 6, 2026
a253874
fix(codegen): satisfy wasm bridge clippy
pgherveou Jul 6, 2026
a46e8fe
Merge remote-tracking branch 'origin/rust-core/04-wasm-bridge-codegen…
pgherveou Jul 6, 2026
23ebade
Merge remote-tracking branch 'origin/rust-core/05-host-wasm' into rus…
pgherveou Jul 6, 2026
1735b8a
test(server): wait for auth sync callback
pgherveou Jul 6, 2026
01ddadc
Merge remote-tracking branch 'origin/rust-core/03-server-runtime' int…
pgherveou Jul 6, 2026
487b2d7
Merge remote-tracking branch 'origin/rust-core/04-wasm-bridge-codegen…
pgherveou Jul 6, 2026
a5113fe
Merge remote-tracking branch 'origin/rust-core/05-host-wasm' into rus…
pgherveou Jul 6, 2026
f421258
test(server): make pairing snapshot test deterministic
pgherveou Jul 6, 2026
2fc5be9
Merge remote-tracking branch 'origin/rust-core/03-server-runtime' int…
pgherveou Jul 6, 2026
c137fef
Merge remote-tracking branch 'origin/rust-core/04-wasm-bridge-codegen…
pgherveou Jul 6, 2026
980d597
Merge remote-tracking branch 'origin/rust-core/05-host-wasm' into rus…
pgherveou Jul 6, 2026
7190552
chore(stack): move wasm bridge out of runtime layer
pgherveou Jul 6, 2026
c3c243b
Merge remote-tracking branch 'origin/rust-core/03-server-runtime' int…
pgherveou Jul 6, 2026
71c910f
Merge remote-tracking branch 'origin/rust-core/04-wasm-bridge-codegen…
pgherveou Jul 6, 2026
2b766bb
Merge remote-tracking branch 'origin/rust-core/05-host-wasm' into rus…
pgherveou Jul 6, 2026
5fbf0b3
fixup! feat(truapi-server): add platform runtime and host bridge
pgherveou Jul 6, 2026
07a3a1c
Merge branch 'rust-core/03-server-runtime' into rust-core/04-wasm-bri…
pgherveou Jul 6, 2026
c75688a
Merge branch 'rust-core/04-wasm-bridge-codegen' into rust-core/05-hos…
pgherveou Jul 6, 2026
95516f7
fixup! feat(truapi-server): add platform runtime and host bridge
pgherveou Jul 6, 2026
9f0a7ef
Merge branch 'rust-core/03-server-runtime' into rust-core/04-wasm-bri…
pgherveou Jul 6, 2026
00942fa
Merge branch 'rust-core/04-wasm-bridge-codegen' into rust-core/05-hos…
pgherveou Jul 6, 2026
57b462a
Merge branch 'rust-core/05-host-wasm' into rust-core/06-docs-ci-tooling
pgherveou Jul 6, 2026
86ffc19
fixup! feat(truapi-server): add platform runtime and host bridge
pgherveou Jul 6, 2026
5f21721
Merge branch 'rust-core/03-server-runtime' into rust-core/04-wasm-bri…
pgherveou Jul 6, 2026
781efcb
Merge branch 'rust-core/04-wasm-bridge-codegen' into rust-core/05-hos…
pgherveou Jul 6, 2026
53ab869
Merge branch 'rust-core/05-host-wasm' into rust-core/06-docs-ci-tooling
pgherveou Jul 6, 2026
98b1023
fixup! feat(truapi-server): add platform runtime and host bridge
pgherveou Jul 6, 2026
c4f7c02
Merge branch 'rust-core/03-server-runtime' into rust-core/04-wasm-bri…
pgherveou Jul 6, 2026
0b9c962
Merge branch 'rust-core/04-wasm-bridge-codegen' into rust-core/05-hos…
pgherveou Jul 6, 2026
d7b3247
Merge branch 'rust-core/05-host-wasm' into rust-core/06-docs-ci-tooling
pgherveou Jul 6, 2026
b639cb7
fixup! feat(truapi-server): add platform runtime and host bridge
pgherveou Jul 7, 2026
ee797ed
Merge branch 'rust-core/03-server-runtime' into rust-core/04-wasm-bri…
pgherveou Jul 7, 2026
95ce2e9
fixup! feat(codegen): generate wasm bridge callbacks
pgherveou Jul 7, 2026
b0887cb
Merge branch 'rust-core/04-wasm-bridge-codegen' into rust-core/05-hos…
pgherveou Jul 7, 2026
4d2fe57
fixup! feat(host-wasm): add @parity/truapi-host-wasm runtime
pgherveou Jul 7, 2026
52b6852
Merge branch 'rust-core/05-host-wasm' into rust-core/06-docs-ci-tooling
pgherveou Jul 7, 2026
4822ee8
fixup! chore: docs, CI, tooling, and dotli integration for the Rust core
pgherveou Jul 7, 2026
4bdb9b5
fixup! feat(truapi-server): add platform runtime and host bridge
pgherveou Jul 8, 2026
9875241
Merge branch 'rust-core/03-server-runtime' into rust-core/04-wasm-bri…
pgherveou Jul 8, 2026
9df1053
Merge branch 'rust-core/04-wasm-bridge-codegen' into rust-core/05-hos…
pgherveou Jul 8, 2026
521b20e
Merge branch 'rust-core/04-wasm-bridge-codegen' into rust-core/05-hos…
pgherveou Jul 8, 2026
4fb288e
fixup! feat(codegen): generate wasm bridge callbacks
pgherveou Jul 8, 2026
06af617
fixup! feat(host-wasm): add @parity/truapi-host-wasm runtime
pgherveou Jul 8, 2026
3e1cfae
Merge branch 'rust-core/05-host-wasm' into rust-core/06-docs-ci-tooling
pgherveou Jul 8, 2026
33e5545
fixup! chore: docs, CI, tooling, and dotli integration for the Rust core
pgherveou Jul 8, 2026
3a64291
refactor(platform): derive allowance Debug
pgherveou Jul 8, 2026
4757653
Merge branch 'rust-core/03-server-runtime' into rust-core/04-wasm-bri…
pgherveou Jul 8, 2026
1e28a14
Merge branch 'rust-core/04-wasm-bridge-codegen' into rust-core/05-hos…
pgherveou Jul 8, 2026
185f392
Merge branch 'rust-core/05-host-wasm' into rust-core/06-docs-ci-tooling
pgherveou Jul 8, 2026
a99f0e5
fix(runtime): keep allowance signing in Rust
pgherveou Jul 8, 2026
e53b78e
Merge branch 'rust-core/03-server-runtime' into rust-core/04-wasm-bri…
pgherveou Jul 8, 2026
7822d7f
Merge branch 'rust-core/04-wasm-bridge-codegen' into rust-core/05-hos…
pgherveou Jul 8, 2026
f090987
Merge branch 'rust-core/05-host-wasm' into rust-core/06-docs-ci-tooling
pgherveou Jul 8, 2026
d6109b4
chore(dotli): merge main into host branch
pgherveou Jul 8, 2026
80135ef
fix(runtime): harden pairing failures
pgherveou Jul 8, 2026
b24a693
Merge branch 'rust-core/03-server-runtime' into rust-core/04-wasm-bri…
pgherveou Jul 8, 2026
b3a8f2d
Merge branch 'rust-core/04-wasm-bridge-codegen' into rust-core/05-hos…
pgherveou Jul 8, 2026
6068c74
Merge branch 'rust-core/05-host-wasm' into rust-core/06-docs-ci-tooling
pgherveou Jul 8, 2026
54b2a7f
chore(dotli): update host integration fixes
pgherveou Jul 8, 2026
3f775f3
fix(runtime): simplify pairing outcome
pgherveou Jul 8, 2026
defe071
Merge branch 'rust-core/03-server-runtime' into rust-core/04-wasm-bri…
pgherveou Jul 8, 2026
812ddf6
Merge branch 'rust-core/04-wasm-bridge-codegen' into rust-core/05-hos…
pgherveou Jul 8, 2026
57d47f3
Merge branch 'rust-core/05-host-wasm' into rust-core/06-docs-ci-tooling
pgherveou Jul 8, 2026
3c97ceb
ci: format generated Rust codegen output
pgherveou Jul 8, 2026
8161d60
Merge branch 'rust-core/04-wasm-bridge-codegen' into rust-core/05-hos…
pgherveou Jul 8, 2026
9303e30
Merge branch 'rust-core/05-host-wasm' into rust-core/06-docs-ci-tooling
pgherveou Jul 8, 2026
eb39fd4
ci: enforce codegen parity checks
pgherveou Jul 8, 2026
3567b19
ci: refresh workflow pins
pgherveou Jul 8, 2026
4132406
fixup! feat(codegen): generate wasm bridge callbacks
pgherveou Jul 8, 2026
19210f4
Merge branch 'rust-core/04-wasm-bridge-codegen' into rust-core/05-hos…
pgherveou Jul 8, 2026
d97ffc7
refactor(host-wasm): rename host package
pgherveou Jul 8, 2026
09fd164
Merge branch 'rust-core/05-host-wasm' into rust-core/06-docs-ci-tooling
pgherveou Jul 8, 2026
c2db654
chore: update host package release tooling
pgherveou Jul 8, 2026
747f412
Merge remote-tracking branch 'origin/main' into rust-core/04-wasm-bri…
pgherveou Jul 9, 2026
4e6ab3b
Merge branch 'rust-core/04-wasm-bridge-codegen' into rust-core/05-hos…
pgherveou Jul 9, 2026
a97a5fd
Merge branch 'rust-core/05-host-wasm' into rust-core/06-docs-ci-tooling
pgherveou Jul 9, 2026
f90c233
ci: install rustfmt for codegen job
pgherveou Jul 9, 2026
0f18a5e
Merge branch 'rust-core/04-wasm-bridge-codegen' into rust-core/05-hos…
pgherveou Jul 9, 2026
39857cb
Merge branch 'rust-core/05-host-wasm' into rust-core/06-docs-ci-tooling
pgherveou Jul 9, 2026
39ef3b0
feat: tighten wasm size profile
pgherveou Jul 9, 2026
1e33292
refactor(codegen): remove flat host callbacks
pgherveou Jul 9, 2026
ff1aaf4
Merge branch 'rust-core/04-wasm-bridge-codegen' into rust-core/05-hos…
pgherveou Jul 9, 2026
4f8379f
test(host): use namespaced callbacks
pgherveou Jul 9, 2026
fc5d548
Merge branch 'rust-core/05-host-wasm' into rust-core/06-docs-ci-tooling
pgherveou Jul 9, 2026
e7f8d4d
test(host): cover worker permission auth
pgherveou Jul 9, 2026
b405b0d
Merge branch 'rust-core/05-host-wasm' into rust-core/06-docs-ci-tooling
pgherveou Jul 9, 2026
437650a
fix(host-wasm): address review feedback
pgherveou Jul 9, 2026
7567e00
Merge branch 'rust-core/04-wasm-bridge-codegen' into rust-core/05-hos…
pgherveou Jul 9, 2026
d5c5e46
Merge branch 'rust-core/05-host-wasm' into rust-core/06-docs-ci-tooling
pgherveou Jul 9, 2026
c2444c3
fix(host-wasm): harden worker and iframe plumbing
pgherveou Jul 10, 2026
6ee5df7
Merge branch 'rust-core/05-host-wasm' into rust-core/06-docs-ci-tooling
pgherveou Jul 10, 2026
d46a15b
fix(tooling): harden release and e2e logging
pgherveou Jul 10, 2026
0a45543
Merge branch 'main' into rust-core/05-host-wasm
pgherveou Jul 10, 2026
0273324
fix(e2e): surface preimage authority failures
pgherveou Jul 10, 2026
e8f048e
Merge remote-tracking branch 'origin/rust-core/05-host-wasm' into rus…
pgherveou Jul 10, 2026
e84b9e8
test(host-wasm): wait for subscription errors
pgherveou Jul 10, 2026
bee28e3
Merge remote-tracking branch 'origin/rust-core/05-host-wasm' into rus…
pgherveou Jul 10, 2026
5c90c25
fix(e2e): update dotli preimage handling
pgherveou Jul 10, 2026
7440bcb
chore(stack): sync #253 with source branch
pgherveou Jul 10, 2026
e7f56a7
Merge branch 'main' into rust-core/06-docs-ci-tooling
pgherveou Jul 10, 2026
2e47b90
test(codegen): format platform goldens
pgherveou Jul 10, 2026
447ec07
test(codegen): pin prettier in goldens
pgherveou Jul 10, 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
2 changes: 1 addition & 1 deletion .changeset/rename-provider-to-wireprovider.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
"@parity/truapi": patch
"@parity/truapi": minor
---

Rename the exported `Provider` transport type to `WireProvider` to make its role explicit. It is the low-level SCALE-wire-frame pipe (a `MessagePort` or iframe `postMessage` channel) that `createTransport` runs on. The `createIframeProvider` / `createMessagePortProvider` factories are unchanged; only the type name moves. Consumers importing `Provider` should import `WireProvider` instead.
2 changes: 1 addition & 1 deletion .changeset/truapi-sandbox-bootstrap.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
"@parity/truapi": patch
"@parity/truapi": minor
---

Add the `@parity/truapi/sandbox` entry point: host-environment detection (`isCorrectEnvironment`), a lazily-built cached client (`getClientSync`, `null` outside a host container), and a `subscribeConnectionStatus` connected/disconnected listener. Browser-embedded hosts can bootstrap a client without assembling the transport by hand.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
rust/crates/truapi-codegen/tests/golden/* linguist-generated=true
rust/crates/truapi-server/src/generated/* linguist-generated=true
5 changes: 2 additions & 3 deletions .github/PULL_REQUEST_TEMPLATE/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

> [!IMPORTANT]
> The PR title must start with `release:` for the publish workflow to fire.
> Example: `release: @parity/truapi 0.1.1`.
> Example: `release: @parity/truapi 0.1.1` or `release: @parity/truapi-host 0.1.1`.
> Don't rewrite the squash commit subject in the merge dialog — the
> `release:` prefix has to land on `main`.

Expand All @@ -12,10 +12,9 @@

### Checklist

- [ ] Ran `npm run changeset` and selected the bump type (patch / minor / major)
- [ ] Ran `npm run changeset` and selected the package + bump type (patch / minor / major)
- [ ] Ran `npm run version-packages` to consume the changeset
- [ ] `js/packages/truapi/package.json` version is bumped
- [ ] `js/packages/truapi/CHANGELOG.md` has the new entry
- [ ] `rust/crates/truapi/Cargo.toml` version matches `js/packages/truapi/package.json`
- [ ] No leftover files under `.changeset/` (other than `config.json`)

12 changes: 11 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,15 @@ jobs:
- name: Run codegen
run: ./scripts/codegen.sh

- name: Check generated Rust output is committed
run: |
git diff --exit-code -- \
rust/crates/truapi-server/src/generated \
rust/crates/truapi-server/src/wasm/generated_bridge.rs

- name: Check Rust/TS wire table parity
run: TRUAPI_REQUIRE_GENERATED_TS=1 cargo test -p truapi-server --test wire_table_ts_parity

- name: Upload codegen output
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
Expand All @@ -105,10 +114,11 @@ jobs:
js/packages/truapi/src/playground/codegen
js/packages/truapi/src/explorer/codegen
js/packages/truapi/src/explorer/versions.ts
js/packages/truapi-host/src/generated
playground/test/generated

ts-client:
name: '@parity/truapi'
name: "@parity/truapi"
runs-on: ubuntu-latest
needs: codegen
env:
Expand Down
134 changes: 100 additions & 34 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ name: Release
# guarded by conclusion == success and a release: commit subject, and checks
# out the pinned head_sha with persist-credentials: false. No untrusted PR code
# ever runs in this privileged context.
on: # zizmor: ignore[dangerous-triggers]
on: # zizmor: ignore[dangerous-triggers]
workflow_run:
workflows: ["CI"]
types: [completed]
Expand All @@ -29,26 +29,54 @@ jobs:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
attestations: write
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 0
ref: ${{ github.event.workflow_run.head_sha }}
persist-credentials: false

- name: Resolve target version
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: "22"
registry-url: "https://registry.npmjs.org"

- name: Resolve target packages
id: version
run: |
version=$(jq -r '.version' js/packages/truapi/package.json)
tag="@parity/truapi@${version}"
if git rev-parse --verify --quiet "refs/tags/${tag}" >/dev/null; then
echo "Tag ${tag} already exists; nothing to publish."
echo "proceed=false" >> "$GITHUB_OUTPUT"
else
echo "Publishing ${tag}."
set -euo pipefail
packages=(
"@parity/truapi js/packages/truapi"
"@parity/truapi-host js/packages/truapi-host"
)
pending="$(mktemp)"
for entry in "${packages[@]}"; do
name="${entry%% *}"
path="${entry#* }"
version="$(jq -r '.version' "${path}/package.json")"
tag="${name}@${version}"
if npm_status="$(npm view "${tag}" version --registry=https://registry.npmjs.org 2>&1)"; then
echo "Package ${tag} already exists on npm; skipping ${name}."
elif grep -Eq 'E404|404 Not Found' <<< "${npm_status}"; then
echo "Publishing ${tag}."
echo "${name}|${path}|${version}|${tag}" >> "${pending}"
else
echo "${npm_status}" >&2
exit 1
fi
done
if [ -s "${pending}" ]; then
echo "proceed=true" >> "$GITHUB_OUTPUT"
echo "version=${version}" >> "$GITHUB_OUTPUT"
echo "tag=${tag}" >> "$GITHUB_OUTPUT"
{
echo "packages<<EOF"
cat "${pending}"
echo "EOF"
} >> "$GITHUB_OUTPUT"
else
echo "No unpublished package tags found."
echo "proceed=false" >> "$GITHUB_OUTPUT"
fi

- if: steps.version.outputs.proceed == 'true'
Expand All @@ -64,35 +92,36 @@ jobs:
- if: steps.version.outputs.proceed == 'true'
uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2

- if: steps.version.outputs.proceed == 'true'
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: "22"
registry-url: "https://registry.npmjs.org"

- name: Install dependencies
if: steps.version.outputs.proceed == 'true'
run: npm ci

- name: Build @parity/truapi
if: steps.version.outputs.proceed == 'true'
run: ./scripts/codegen.sh
- name: Install wasm-pack
if: steps.version.outputs.proceed == 'true' && contains(steps.version.outputs.packages, '@parity/truapi-host|')
run: cargo install wasm-pack --version 0.14.0 --locked

- name: Tag release
- name: Build packages
if: steps.version.outputs.proceed == 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
STEPS_VERSION_OUTPUTS_TAG: ${{ steps.version.outputs.tag }}
run: |
gh api repos/${{ github.repository }}/git/refs \
-f ref="refs/tags/${STEPS_VERSION_OUTPUTS_TAG}" \
-f sha="${{ github.event.workflow_run.head_sha }}"
set -euo pipefail
./scripts/codegen.sh
if grep -q '^@parity/truapi-host|' <<< "${STEPS_VERSION_OUTPUTS_PACKAGES}"; then
npm run build --prefix js/packages/truapi-host
npm run build:wasm --prefix js/packages/truapi-host
fi
env:
STEPS_VERSION_OUTPUTS_PACKAGES: ${{ steps.version.outputs.packages }}

- name: Pack package
if: steps.version.outputs.proceed == 'true'
run: |
set -euo pipefail
mkdir -p artifacts
(cd js/packages/truapi && npm pack --pack-destination "$GITHUB_WORKSPACE/artifacts/")
while IFS='|' read -r name path version tag; do
(cd "${path}" && npm pack --pack-destination "$GITHUB_WORKSPACE/artifacts/")
done <<< "${STEPS_VERSION_OUTPUTS_PACKAGES}"
env:
STEPS_VERSION_OUTPUTS_PACKAGES: ${{ steps.version.outputs.packages }}

- name: Upload package artifacts
if: steps.version.outputs.proceed == 'true'
Expand All @@ -101,6 +130,12 @@ jobs:
name: package
path: artifacts/*.tgz

- name: Attest package artifacts
if: steps.version.outputs.proceed == 'true'
uses: actions/attest-build-provenance@0f67c3f4856b2e3261c31976d6725780e5e4c373 # v4.1.1
with:
subject-path: artifacts/*.tgz

- name: Publish via npm_publish_automation
if: steps.version.outputs.proceed == 'true'
uses: octokit/request-action@b91aabaa861c777dcdb14e2387e30eddf04619ae # v3.0.0
Expand All @@ -111,14 +146,45 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.NPM_PUBLISH_AUTOMATION_TOKEN }}

- name: Create release tags
if: steps.version.outputs.proceed == 'true'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_SHA: ${{ github.event.workflow_run.head_sha }}
STEPS_VERSION_OUTPUTS_PACKAGES: ${{ steps.version.outputs.packages }}
run: |
set -euo pipefail
auth_header="AUTHORIZATION: bearer ${GITHUB_TOKEN}"
push_refs=()
while IFS='|' read -r name path version tag; do
if git -c http.extraheader="${auth_header}" ls-remote --exit-code --tags origin "refs/tags/${tag}" >/dev/null 2>&1; then
echo "Tag ${tag} already exists; skipping create."
continue
fi
git tag --force "${tag}" "${RELEASE_SHA}"
push_refs+=("refs/tags/${tag}:refs/tags/${tag}")
done <<< "${STEPS_VERSION_OUTPUTS_PACKAGES}"

if [ "${#push_refs[@]}" -gt 0 ]; then
git -c http.extraheader="${auth_header}" push origin "${push_refs[@]}"
fi

- name: Create GitHub Release
if: steps.version.outputs.proceed == 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
STEPS_VERSION_OUTPUTS_TAG: ${{ steps.version.outputs.tag }}
STEPS_VERSION_OUTPUTS_VERSION: ${{ steps.version.outputs.version }}
STEPS_VERSION_OUTPUTS_PACKAGES: ${{ steps.version.outputs.packages }}
run: |
gh release create "${STEPS_VERSION_OUTPUTS_TAG}" \
--title "@parity/truapi ${STEPS_VERSION_OUTPUTS_VERSION}" \
--generate-notes \
artifacts/*.tgz
set -euo pipefail
while IFS='|' read -r name path version tag; do
tarball_name="${name#@}"
tarball_name="${tarball_name//\//-}-${version}.tgz"
if gh release view "${tag}" >/dev/null 2>&1; then
gh release upload "${tag}" "artifacts/${tarball_name}" --clobber
else
gh release create "${tag}" \
--title "${name} ${version}" \
--generate-notes \
"artifacts/${tarball_name}"
fi
done <<< "${STEPS_VERSION_OUTPUTS_PACKAGES}"
Loading