Skip to content
Draft
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
149 changes: 149 additions & 0 deletions .github/workflows/live-messaging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
name: Live Messaging

on:
workflow_dispatch:
inputs:
x0x_ref:
description: "x0x git ref to test against"
required: true
default: "v0.21.4"
schedule:
- cron: "23 2 * * *"

concurrency:
group: live-messaging-${{ github.ref }}
cancel-in-progress: true

env:
X0X_REF: ${{ inputs.x0x_ref || 'v0.21.4' }}

jobs:
dioxus-live-messaging:
name: Dioxus Live Messaging E2E
runs-on: ubuntu-24.04
timeout-minutes: 60
steps:
- uses: actions/checkout@v4

- uses: actions/checkout@v4
with:
repository: saorsa-labs/x0x
ref: ${{ env.X0X_REF }}
path: x0x

- name: Make x0x available as sibling checkout
run: |
if [ ! -e "$GITHUB_WORKSPACE/../x0x" ]; then
ln -s "$GITHUB_WORKSPACE/x0x" "$GITHUB_WORKSPACE/../x0x"
fi

- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential \
curl \
file \
libssl-dev \
pkg-config \
libgtk-3-dev \
libayatana-appindicator3-dev \
librsvg2-dev \
libsoup-3.0-dev \
libpipewire-0.3-dev \
libasound2-dev \
libdbus-1-dev \
libxdo-dev
sudo apt-get install -y libwebkit2gtk-4.1-dev libjavascriptcoregtk-4.1-dev \
|| sudo apt-get install -y libwebkit2gtk-4.0-dev libjavascriptcoregtk-4.0-dev

- name: Install Rust
uses: dtolnay/rust-toolchain@stable

- name: Rust Cache
uses: Swatinem/rust-cache@v2
with:
workspaces: |
. -> target
x0x -> target
cache-on-failure: false
shared-key: live-messaging-dioxus

- name: Run Dioxus live parity harness
env:
X0X_DIR: ${{ github.workspace }}/x0x
run: bash communitas-dioxus/tests/e2e.sh

swift-live-messaging:
name: Swift Live Messaging + Golden Paths
runs-on: macos-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v4

- uses: actions/checkout@v4
with:
repository: saorsa-labs/x0x
ref: ${{ env.X0X_REF }}
path: x0x

- name: Install Rust
uses: dtolnay/rust-toolchain@stable

- name: Build x0xd
run: cargo build --manifest-path x0x/Cargo.toml --release --bin x0xd

- name: Run Swift live WebSocket round-trips
working-directory: communitas-apple
env:
X0X_LIVE_TESTS: "1"
X0XD_BIN: ${{ github.workspace }}/x0x/target/release/x0xd
run: swift test --filter PubSubRoundTripTests

- name: Start x0xd for golden-path UI tests
run: |
"$GITHUB_WORKSPACE/x0x/target/release/x0xd" --skip-update-check > "$RUNNER_TEMP/x0xd-ui.log" 2>&1 &
echo "$!" > "$RUNNER_TEMP/x0xd-ui.pid"
for _ in $(seq 1 60); do
if [ -f "$HOME/Library/Application Support/x0x/api.port" ] \
&& [ -f "$HOME/Library/Application Support/x0x/api-token" ]; then
break
fi
sleep 1
done
PORT="$(cat "$HOME/Library/Application Support/x0x/api.port")"
TOKEN="$(cat "$HOME/Library/Application Support/x0x/api-token")"
if [[ "$PORT" == *:* ]]; then
ADDRESS="$PORT"
else
ADDRESS="127.0.0.1:$PORT"
fi
echo "X0X_API_BASE=http://$ADDRESS" >> "$GITHUB_ENV"
echo "X0X_API_TOKEN=$TOKEN" >> "$GITHUB_ENV"

- name: Run Swift golden-path UI tests
working-directory: communitas-apple
env:
COMMUNITAS_RUN_XCUITEST: "1"
X0X_LIVE_TESTS: "1"
run: |
xcodebuild \
-scheme Communitas \
-destination 'platform=macOS' \
-only-testing:CommunitasUITests \
test

- name: Stop x0xd
if: always()
run: |
if [ -f "$RUNNER_TEMP/x0xd-ui.pid" ]; then
kill "$(cat "$RUNNER_TEMP/x0xd-ui.pid")" || true
fi

- name: Upload x0xd UI-test log
uses: actions/upload-artifact@v4
if: always()
with:
name: swift-x0xd-ui-log
path: ${{ runner.temp }}/x0xd-ui.log
if-no-files-found: ignore
14 changes: 13 additions & 1 deletion .github/workflows/release-beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,18 @@ jobs:

# Find the generated .app (use absolute path so subsequent steps work from repo root)
APP_PATH=$(find "$(pwd)/dist" -name "*.app" -type d | head -1)
if [ -z "$APP_PATH" ]; then
echo "ERROR: dx bundle did not produce a macOS .app"
exit 1
fi

INFO_PLIST="$APP_PATH/Contents/Info.plist"
if /usr/libexec/PlistBuddy -c "Print :LSRequiresCarbon" "$INFO_PLIST" >/dev/null 2>&1; then
/usr/libexec/PlistBuddy -c "Delete :LSRequiresCarbon" "$INFO_PLIST"
echo "Removed generated LSRequiresCarbon from $INFO_PLIST"
fi
plutil -p "$INFO_PLIST" | grep -E 'CFBundleIdentifier|CFBundleName|CFBundleDisplayName|LSRequiresCarbon' || true

echo "app_path=$APP_PATH" >> $GITHUB_OUTPUT

# Replace binary with universal one
Expand Down Expand Up @@ -307,7 +319,7 @@ jobs:
run: |
cargo install --locked \
--git https://github.com/saorsa-labs/x0x \
--tag v0.19.51 \
--tag v0.21.4 \
--bin x0x-keygen \
x0x
x0x-keygen --help
Expand Down
18 changes: 15 additions & 3 deletions .github/workflows/release-swift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,21 @@ jobs:
</plist>
EOF

# Ensure the binary can find Sparkle at @rpath
# SPM sets @rpath to the build directory; we need it to point into the .app bundle
install_name_tool -add_rpath "@executable_path/../Frameworks" "$MACOS_DIR/Communitas" 2>/dev/null || true
# Ensure the binary can find Sparkle at @rpath.
# SPM leaves build-directory rpaths in the binary; packaged apps must resolve
# frameworks from inside Contents/Frameworks.
add_bundle_rpath() {
local rpath="$1"
if otool -l "$MACOS_DIR/Communitas" | grep -A2 LC_RPATH | grep -Fq "path ${rpath} "; then
echo "Rpath already present: ${rpath}"
else
install_name_tool -add_rpath "$rpath" "$MACOS_DIR/Communitas"
echo "Added rpath: ${rpath}"
fi
}

add_bundle_rpath "@executable_path/../Frameworks"
add_bundle_rpath "@loader_path/../Frameworks"
echo "Rpaths configured:"
otool -l "$MACOS_DIR/Communitas" | grep -A2 LC_RPATH || true

Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,18 @@ jobs:

# Find the generated .app (use absolute path so subsequent steps work from repo root)
APP_PATH=$(find "$(pwd)/dist" -name "*.app" -type d | head -1)
if [ -z "$APP_PATH" ]; then
echo "ERROR: dx bundle did not produce a macOS .app"
exit 1
fi

INFO_PLIST="$APP_PATH/Contents/Info.plist"
if /usr/libexec/PlistBuddy -c "Print :LSRequiresCarbon" "$INFO_PLIST" >/dev/null 2>&1; then
/usr/libexec/PlistBuddy -c "Delete :LSRequiresCarbon" "$INFO_PLIST"
echo "Removed generated LSRequiresCarbon from $INFO_PLIST"
fi
plutil -p "$INFO_PLIST" | grep -E 'CFBundleIdentifier|CFBundleName|CFBundleDisplayName|LSRequiresCarbon' || true

echo "app_path=$APP_PATH" >> $GITHUB_OUTPUT

# Replace binary with universal one
Expand Down
Loading
Loading