Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
0f6e1dc
docs(swift): add design for native Swift client
ampagent Oct 19, 2026
b173358
build(swift): scaffold Swift package, conformance package, and CI
ampagent Oct 19, 2026
b113f73
ci(swift): run Swift workflows on the swift-client branch
ampagent Oct 19, 2026
7c86b2c
feat(swift): port JSON, hashing, AST normalization, and value primitives
ampagent Oct 19, 2026
68b9132
feat(swift): port IVM operators, pipeline builder, views, and query b…
ampagent Oct 19, 2026
5224aa8
feat(swift): port the zero-protocol wire messages
ampagent Oct 19, 2026
d118ecf
fix(conformance): generate vectors on the pinned Node, guard JSON.parse
ampagent Oct 19, 2026
0d03fef
feat(swift): walking skeleton against a real zero-cache
ampagent Oct 19, 2026
1438f2f
feat(swift): typed key-path query builder and zero-swift codegen
ampagent Oct 19, 2026
f0e5b16
test(conformance): client scenario vectors from the JS zero-client
ampagent Oct 19, 2026
d5feca2
feat(swift): client engine on memory storage (M4)
ampagent Oct 19, 2026
7ebad7b
test(conformance): persistence scenarios with a restart step
ampagent Oct 19, 2026
3974fdf
feat(swift): SQLite persistence and the client lifecycle (M5)
ampagent Oct 19, 2026
690870a
test(conformance): visibility scenarios with a fake document
ampagent Oct 19, 2026
fcb9aef
feat(swift): app lifecycle, live queries, and the Apple layer (M6)
ampagent Oct 19, 2026
a717844
fix(swift): build the SwiftUI and AppKit helpers on macOS
ampagent Oct 19, 2026
62e6a40
test(swift): the whole client against zero-cache end to end
ampagent Oct 19, 2026
4c05e77
fix(swift): compile the Apple tests on macOS
ampagent Oct 19, 2026
a900925
feat(swift): drift harness for Swift ports of TS queries and mutators
ampagent Oct 19, 2026
8294d19
feat(zbugs): zbugs' schema, queries, and mutators in Swift (M7)
ampagent Oct 19, 2026
f0ab0a9
feat(zero-swift): flag mutators that read the clock or make up IDs
ampagent Oct 19, 2026
c1b39f5
feat(swift): read nulls the schema rules out, and share the NIO trans…
ampagent Oct 19, 2026
ba63b8e
feat(zbugs): native app login redirect and a dev token script
ampagent Oct 19, 2026
ee9a0c5
feat(zbugs-swift): the zbugs app for iOS and macOS
ampagent Oct 19, 2026
44512fb
test(zbugs-swift): the Swift port against zbugs' own backend
ampagent Oct 19, 2026
0e51bcc
fix(zbugs-swift): read the project name off the main actor
ampagent Oct 19, 2026
49798f8
fix(zbugs-swift): name the app's module apart from the ZBugs library
ampagent Oct 19, 2026
08e6d1f
perf(swift): what the benchmarks found
ampagent Oct 19, 2026
efd4711
feat(swift): benchmarks, next to the JS ones
ampagent Oct 19, 2026
57bf70f
refactor(swift): keep the engine out of the public API
ampagent Oct 19, 2026
e1541c3
docs(swift): DocC catalogs, a README, and the JS parity matrix
ampagent Oct 19, 2026
6ae3c04
build(zero-swift): bundle the CLI for npm
ampagent Oct 19, 2026
6b8e686
test(zbugs-swift): screenshots of each screen against zbugs' backend
ampagent Oct 19, 2026
5350565
fix(zbugs-swift): make the app model once, in the App
ampagent Oct 19, 2026
04de14f
fix(zbugs-swift): let zero-cache forward to either loopback name
ampagent Oct 19, 2026
5f85ee0
fix(zbugs-swift): issue numbers without separators, a badge that fits…
ampagent Oct 19, 2026
af8aa5f
test(zbugs-swift): screenshots on iPad and macOS too
ampagent Oct 19, 2026
5672896
feat(zbugs-swift): run the app on a device against a backend on the Mac
ampagent Oct 19, 2026
2344a0a
fix(zbugs-swift): room for the filters on macOS, and the picker the t…
ampagent Oct 19, 2026
7986f5a
fix(zbugs-swift): sheets that fit an iPhone, and an AppKit list like …
ampagent Oct 19, 2026
3f6333c
fix(zbugs-swift): keep a row's labels whole in a narrow list
ampagent Oct 19, 2026
f595276
fix(zbugs-swift): highlight the open issue in the UIKit list on an iPad
ampagent Oct 19, 2026
f7c1726
fix(zbugs-swift): give the Mac's list column its width
ampagent Oct 19, 2026
f33ac86
fix(zbugs-swift): keep the UIKit list's highlight when it appears
ampagent Oct 19, 2026
8ea2728
perf(zero-swift): rows keyed by column index
ampagent Oct 19, 2026
314642a
perf(zero-swift): a row in one allocation, shared with the main branch
ampagent Oct 19, 2026
10b81e2
perf(zero-swift): B-tree lookups without retaining each node
ampagent Oct 19, 2026
e3edee2
docs(zero-swift): say Linux needs a socket of your own
ampagent Oct 19, 2026
f24a845
fix(zbugs-swift): the list's large title on an iPhone when it has row…
tmm Oct 19, 2026
87c4f43
test(zbugs-swift): screenshots offline too, from what the app stored
tmm Oct 19, 2026
25962c5
feat(zbugs-swift): a backend that keeps its database across restarts
tmm Oct 19, 2026
088a4de
docs(zbugs-swift): running the app on a device
tmm Oct 19, 2026
21b80d4
fix(zero-swift): ZeroTesting no longer links Testing.framework
ampagent Oct 20, 2026
e4c3ed2
perf(zero-swift): zero.bench checks its sum by column index
ampagent Oct 20, 2026
631f784
docs(zero-swift): benchmarks on the iPhone and an M2 Max first
ampagent Oct 20, 2026
8172d5e
feat(zero-swift): ZeroVirtual, lists that page their rows in
ampagent Oct 20, 2026
36fa8c7
feat(zero-swift): VirtualList, ZeroVirtual's SwiftUI scroll view
ampagent Oct 20, 2026
05b5f8e
perf(zero-swift): ContiguousArray B-trees, struct scans, appending hy…
ampagent Oct 20, 2026
5b9c8dc
fix(zero-swift): VirtualList re-renders every snapshot
ampagent Oct 20, 2026
44cf9f4
fix(zero-swift): VirtualList updates when content rounds below its rows
ampagent Oct 20, 2026
71f3b58
fix(zero-swift): a scroll that lands at the bottom re-arms stick-to-b…
ampagent Oct 20, 2026
3a69780
test(zero-swift): the loopback paging test waits for the last page's …
ampagent Oct 20, 2026
061458e
test(zero-swift): find the scrolled-to row by its place in the window
ampagent Oct 20, 2026
cc9716e
test(zero-swift): virtual list UI tests read rows from one snapshot
ampagent Oct 20, 2026
77ff244
fix(zero-swift): VirtualList no longer takes the scroll view's insets…
ampagent Oct 20, 2026
15db990
fix(zero-swift): pages loading mid-fling no longer stop it
ampagent Oct 20, 2026
25def68
fix(zero-swift): VirtualList keeps row frames through a new space before
ampagent Oct 20, 2026
7a4d539
fix(zero-swift): flings through a list opened mid-way never scroll under
ampagent Oct 20, 2026
16de39f
test(zero-swift): a cheaper fling test, and room for VirtualListTests…
ampagent Oct 20, 2026
1fdb2ea
test(zero-swift): the chat UI test swipes up to 70 times to reach its…
ampagent Oct 20, 2026
9e2e1fe
fix(zero-swift): the give-back at the start scrolls with the space it…
ampagent Oct 20, 2026
bf41176
revert(zero-swift): the give-back at the start scrolls with the space…
ampagent Oct 20, 2026
ca6cec0
test(zero-swift): a frame probe checks every display frame of the vir…
tmm Oct 20, 2026
d026dc5
fix(zero-swift): paging waits for the space that keeps rows in place
tmm Oct 20, 2026
a018d98
fix(zero-swift): VirtualList lays its rows out in a native scroll view
tmm Oct 20, 2026
ce30a2f
test(zero-swift): the frame probe counts dropped frames and opens the…
tmm Oct 20, 2026
45276f2
fix(zero-swift): no gap stands above the first row after a fling to t…
tmm Oct 20, 2026
fd386d3
fix(zero-swift): rows on macOS stay on the content's pixels as it scr…
tmm Oct 20, 2026
461a9b4
test(zero-swift): the frame probe waits for a slow jump to move, and …
tmm Oct 20, 2026
a8d7227
ci(zero-swift): UI tests boot their simulator before launching the app
ampagent Oct 21, 2026
0ff3f12
fix(zero-swift): VirtualList rows read the list's Zero client
ampagent Oct 21, 2026
e238d3f
test(zero-swift): the frame probe's momentum check allows a simulator…
tmm Oct 21, 2026
60be75c
fix(zero-swift): VirtualList rows inherit the list's environment as t…
ampagent Oct 21, 2026
93af68b
test(zero-swift): the core's scrolling tests run on LayoutHost; Scrol…
ampagent Oct 21, 2026
e350974
test(zero-swift): the LayoutHost tests themselves
ampagent Oct 21, 2026
80939cb
feat(zero-swift): VirtualListView, the virtual list for UIKit and AppKit
tmm Oct 21, 2026
fa8f698
test(zero-swift): the UI tests and frame probe run on VirtualListView…
tmm Oct 21, 2026
11ce909
ci: key the Playwright cache by the OS release
ampagent Oct 21, 2026
856850c
chore: merge main (rocicorp/mono at 80f6a7aaf) into swift-client
ampagent Oct 21, 2026
d67d76c
ci: the Swift tooling passes Public Checks, and Public Test runs on U…
ampagent Oct 21, 2026
3bb5ac5
feat(zero-swift): virtual lists get a header, a footer, and a selection
tmm Oct 21, 2026
e7c5919
test(zero-swift): the Issues screen has a header, a footer, and a sel…
tmm Oct 21, 2026
4f0b146
fix(zero-swift): a list leaving doesn't detach the list that took its…
tmm Oct 21, 2026
11bcd1b
feat(zbugs-swift): the issue list and an issue's comments page in as …
tmm Oct 21, 2026
cdb2a80
docs(zero-swift): VirtualListView's header, footer, and selection, by…
tmm Oct 21, 2026
e26bfa6
fix(zero-swift): a VirtualList header or footer that goes lets go of …
tmm Oct 21, 2026
984674b
fix(zbugs-swift): the UIKit issue cell keeps its icon beside a wrappi…
tmm Oct 21, 2026
60fb813
fix(zero-swift): a list opened at a permalink or where it was shows i…
tmm Oct 21, 2026
022e884
docs(zbugs): why the Swift app's login redirect can carry the token
ampagent Oct 21, 2026
d7e7607
ci(zero-swift): the Swift release also publishes the zero-swift CLI t…
ampagent Oct 21, 2026
8fa5d41
test(zero-swift): the frame probe lets a stalled frame scroll past ev…
tmm Oct 21, 2026
1e41ca8
fix(zero-swift): rows are selected by keys on macOS only
tmm Oct 21, 2026
3680ac4
build(zero-swift): the CLI's package names its repository, which npm …
ampagent Oct 21, 2026
dcd8d86
ci(zero-swift): Changesets version the Swift client, and releases pub…
ampagent Oct 21, 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
31 changes: 30 additions & 1 deletion .agents/setup
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ export DEBIAN_FRONTEND=noninteractive

echo '==> Checking native build prerequisites'
missing=()
for package in build-essential python3 pkg-config curl ca-certificates xz-utils; do
# postgresql backs the Swift end-to-end tests (packages/zero-conformance/src/e2e).
for package in build-essential python3 pkg-config curl ca-certificates xz-utils postgresql; do
if [[ "$(dpkg-query -W -f='${Status}' "$package" 2>/dev/null || true)" != 'install ok installed' ]]; then
missing+=("$package")
fi
Expand All @@ -17,6 +18,26 @@ if ((${#missing[@]})); then
time sudo apt-get install -y "${missing[@]}"
fi

echo '==> Installing the Swift toolchain for swift/'
swift_version='6.2.4'
if [[ "$(/opt/swift/usr/bin/swift --version 2>/dev/null || true)" != *"swift-${swift_version}-RELEASE"* ]]; then
time sudo apt-get update
time sudo apt-get install -y binutils-gold libicu-dev libcurl4-openssl-dev \
libedit-dev libsqlite3-dev libncurses-dev libpython3-dev libxml2-dev \
tzdata uuid-dev gnupg2 libstdc++-12-dev zlib1g-dev
swift_tmp="$(mktemp -d)"
time curl -sSfL -o "$swift_tmp/swift.tar.gz" \
"https://download.swift.org/swift-${swift_version}-release/debian12/swift-${swift_version}-RELEASE/swift-${swift_version}-RELEASE-debian12.tar.gz"
sudo rm -rf /opt/swift
sudo mkdir -p /opt/swift
sudo tar -xzf "$swift_tmp/swift.tar.gz" -C /opt/swift --strip-components=1
rm -rf "$swift_tmp"
fi
for tool in swift swiftc sourcekit-lsp docc; do
sudo ln -sf "/opt/swift/usr/bin/$tool" "/usr/local/bin/$tool"
done
swift --version

echo '==> Selecting the repository Node and pnpm versions'
node_version="$(tr -d '[:space:]' < .nvmrc)"
if [[ "$(node -p 'process.versions.node')" != "$node_version" && "$(node -p 'process.versions.node')" != "$node_version".* ]]; then
Expand All @@ -40,6 +61,14 @@ pnpm --version
PATH="${PNPM_HOME:-$HOME/.local/share/pnpm}/bin:$PATH" \
pnpm config set --global verify-deps-before-run false

# zero-cache runs from source only on Node 24 (`using`), which the Swift
# end-to-end server needs; the .nvmrc Node stays the default.
echo '==> Installing Node 24 for zero-cache into ~/.local/node24'
if [[ "$("$HOME/.local/node24/bin/node" --version 2>/dev/null || true)" != v24.* ]]; then
time N_PREFIX="$HOME/.local/node24" n install 24
fi
"$HOME/.local/node24/bin/node" --version

echo '==> Installing workspace dependencies from the lockfile'
time pnpm install --frozen-lockfile

Expand Down
17 changes: 17 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Changesets

Changesets version the Swift client: the `zero-swift` npm package
(`packages/zero-swift-cli`) and the Swift package (`swift/`), which share one
version. Upstream Zero's packages are released separately and are ignored here.

To release a change to either, add a changeset for `zero-swift`:

```sh
pnpm changeset
```

On `main`, `.github/workflows/swift-release.yml` keeps a "Version Packages" pull
request open with the pending version and changelog. Merging it sets the
version in `packages/zero-swift-cli/package.json` and `swift/VERSION`, and the
workflow then publishes the npm package and tags the SwiftPM mirror after
approval in the `swift-release` environment.
10 changes: 10 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"$schema": "https://unpkg.com/@changesets/config@4.0.1/schema.json",
"baseBranch": "main",
"access": "public",
"changelog": "@changesets/cli/changelog",
"commit": false,
"format": "oxfmt",
"ignore": ["@rocicorp/zero-events", "replicache", "otel-proxy"],
"privatePackages": {"version": false, "tag": false}
}
8 changes: 6 additions & 2 deletions .github/actions/playwright-install/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,18 @@ runs:
steps:
- name: Get Playwright version
id: playwright-version
run: echo "version=$(pnpm exec playwright --version | awk '{print $NF}')" >> "$GITHUB_OUTPUT"
# The OS release too: browsers built for one Ubuntu release don't run
# on the next, which ubuntu-latest moves to.
run: |
echo "version=$(pnpm exec playwright --version | awk '{print $NF}')" >> "$GITHUB_OUTPUT"
echo "os=$(. /etc/os-release && echo "$ID-$VERSION_ID")" >> "$GITHUB_OUTPUT"
shell: bash
- name: Cache Playwright browsers
id: playwright-cache
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ runner.arch }}-${{ steps.playwright-version.outputs.version }}
key: playwright-${{ runner.os }}-${{ steps.playwright-version.outputs.os }}-${{ runner.arch }}-${{ steps.playwright-version.outputs.version }}
- name: Install Playwright browsers and system deps
if: steps.playwright-cache.outputs.cache-hit != 'true'
run: timeout -k 30s 20m pnpm exec playwright install --with-deps
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/public-js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,9 @@ jobs:
test:
name: Public Test
if: github.repository == 'rocicorp/mono' || github.repository == 'rocicorp/mono-internal' || github.repository == 'wevm/zero'
# See Public Checks. x64, since this runs WebKit and Firefox too.
runs-on: ${{ github.repository == 'rocicorp/mono-internal' && 'ubuntu-x64-8-core' || 'ubuntu-latest' }}
# See Public Checks. x64, since this runs WebKit and Firefox too. Ubuntu
# 24.04, not ubuntu-latest: Playwright 1.60 has no browsers for 26.04.
runs-on: ${{ github.repository == 'rocicorp/mono-internal' && 'ubuntu-x64-8-core' || 'ubuntu-24.04' }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
Expand Down
81 changes: 81 additions & 0 deletions .github/workflows/swift-macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Swift (macOS)

# The Apple-only layer (ZeroUI, the URLSession transport) and iOS simulator
# tests. Path-filtered because macOS runners are slow to start.

on:
push:
# swift-client is the development branch until the client lands on main.
branches: [main, swift-client]
paths:
- 'swift/**'
- 'packages/zero-conformance/**'
- 'apps/zbugs-swift/**'
- '.github/workflows/swift-macos.yml'
pull_request:
branches: [main]
paths:
- 'swift/**'
- 'packages/zero-conformance/**'
- 'apps/zbugs-swift/**'
- '.github/workflows/swift-macos.yml'

concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

permissions:
contents: read

jobs:
macos:
name: Swift (macOS)
runs-on: macos-26
timeout-minutes: 45
defaults:
run:
working-directory: swift
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- run: swift --version
- name: Build and test (macOS)
run: swift test
- name: Docs
run: scripts/docs.sh
- name: Test (iOS Simulator)
run: |
device="$(xcrun simctl list devices available -j |
python3 -c 'import json,sys; d=json.load(sys.stdin)["devices"]; print(next(x["udid"] for k,v in d.items() if "iOS" in k for x in v if x["name"].startswith("iPhone")))')"
xcodebuild test -scheme Zero-Package -destination "id=$device" -skipPackagePluginValidation

zbugs:
name: zbugs app (iOS and macOS)
runs-on: macos-26
timeout-minutes: 45
defaults:
run:
working-directory: apps/zbugs-swift
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
# The drift test again, and ZBugsUI (empty on Linux) for macOS.
- name: Build and test (macOS)
run: swift test
- name: Generate the Xcode project
working-directory: apps/zbugs-swift/App
run: brew install xcodegen && xcodegen generate
- name: Build the app (iOS Simulator)
working-directory: apps/zbugs-swift/App
run: >-
xcodebuild build -project ZBugs.xcodeproj -scheme ZBugsApp
-destination 'generic/platform=iOS Simulator'
-skipPackagePluginValidation CODE_SIGNING_ALLOWED=NO
- name: Build the app (macOS)
working-directory: apps/zbugs-swift/App
run: >-
xcodebuild build -project ZBugs.xcodeproj -scheme ZBugsApp
-destination 'generic/platform=macOS'
-skipPackagePluginValidation CODE_SIGNING_ALLOWED=NO
167 changes: 167 additions & 0 deletions .github/workflows/swift-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
name: Swift Release

# Releases the Swift client, versioned with Changesets (see .changeset/README.md).
# The zero-swift npm package (packages/zero-swift-cli) and the Swift package
# (swift/) share one version, kept in step by `pnpm changeset:version`.
#
# On each push to main:
# - With pending changesets, opens or updates the "Version Packages" PR.
# - Otherwise, if the version in swift/VERSION isn't released yet, after
# approval in the swift-release environment:
# - publishes swift/ to the SwiftPM mirror (wevm/zero-swift) and tags the
# version there. SwiftPM needs Package.swift at a repository root and
# clones whole repositories, so consumers install from the mirror.
# - publishes the zero-swift CLI to npm with trusted publishing.
# Each step is skipped when its release already exists, so a failed run can be
# rerun.

on:
push:
branches: [main]
workflow_dispatch:

permissions:
contents: read

concurrency:
group: swift-release
cancel-in-progress: false

jobs:
version:
name: Version PR
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
outputs:
has-changesets: ${{ steps.changesets.outputs.has-changesets }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
with:
version: 11.11.0
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version-file: .nvmrc
package-manager-cache: false
- run: pnpm install --frozen-lockfile
- id: changesets
uses: changesets/action@ae32849d5ba541f9ae29e40e22a623bc13562f51 # v2.1.2
with:
version-script: pnpm changeset:version
commit-message: 'chore(zero-swift): version packages'
pr-title: 'chore(zero-swift): version packages'

plan:
name: Plan release
runs-on: ubuntu-latest
needs: version
if: needs.version.outputs.has-changesets == 'false'
outputs:
version: ${{ steps.plan.outputs.version }}
mirror: ${{ steps.plan.outputs.mirror }}
npm: ${{ steps.plan.outputs.npm }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
sparse-checkout: |
swift/VERSION
packages/zero-swift-cli/package.json
sparse-checkout-cone-mode: false
- id: plan
run: |
set -euo pipefail
version="$(tr -d '[:space:]' < swift/VERSION)"
package="$(jq -r .version packages/zero-swift-cli/package.json)"
if [ "$package" != "$version" ]; then
echo "packages/zero-swift-cli is $package but swift/VERSION is $version." >&2
exit 1
fi
echo "version=$version" >> "$GITHUB_OUTPUT"
if git ls-remote --exit-code --tags https://github.com/wevm/zero-swift.git "refs/tags/$version" >/dev/null; then
echo "mirror=false" >> "$GITHUB_OUTPUT"
else
echo "mirror=true" >> "$GITHUB_OUTPUT"
fi
if npm view "zero-swift@$version" version >/dev/null 2>&1; then
echo "npm=false" >> "$GITHUB_OUTPUT"
else
echo "npm=true" >> "$GITHUB_OUTPUT"
fi

mirror:
name: Publish mirror
runs-on: ubuntu-latest
needs: plan
if: needs.plan.outputs.mirror == 'true'
environment: swift-release
env:
MIRROR_TOKEN: ${{ secrets.ZERO_SWIFT_MIRROR_TOKEN }}
MIRROR_REPO: wevm/zero-swift
VERSION: ${{ needs.plan.outputs.version }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 0
persist-credentials: false
- name: Split and push
run: |
set -euo pipefail
git subtree split --prefix=swift -b mirror
remote="https://x-access-token:${MIRROR_TOKEN}@github.com/${MIRROR_REPO}.git"
git push "$remote" mirror:main
git tag "$VERSION" mirror
git push "$remote" "refs/tags/$VERSION"

npm-build:
name: Build npm package
runs-on: ubuntu-latest
needs: plan
if: needs.plan.outputs.npm == 'true'
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
with:
version: 11.11.0
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version-file: .nvmrc
package-manager-cache: false
- run: pnpm install --frozen-lockfile
- name: Build and pack
run: |
pnpm --filter zero-swift build
pnpm --filter zero-swift pack --pack-destination "$GITHUB_WORKSPACE/dist/npm"
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: zero-swift-npm
path: dist/npm/*.tgz
if-no-files-found: error

npm-publish:
name: Publish npm package
runs-on: ubuntu-latest
needs: [plan, npm-build]
environment: swift-release
permissions:
contents: read
id-token: write # For npm trusted publishing.
env:
VERSION: ${{ needs.plan.outputs.version }}
steps:
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: 24.x
registry-url: 'https://registry.npmjs.org'
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: zero-swift-npm
path: dist/npm
- name: Publish
run: npm publish "dist/npm/zero-swift-$VERSION.tgz" --provenance --access public
Loading
Loading