Compare commits

..

6 Commits

Author SHA1 Message Date
bd5bfb0f1e
ci: remove unused remote_contract job from build-and-release workflow (#71)
The remote_contract job was effectively dead code — it only ran on
workflow_dispatch (excluded push and pull_request events) and was
configured with continue-on-error, so it never blocked releases.

Removing it simplifies the pipeline and eliminates the always()
workaround in the release job's if-condition.

Co-authored-by: Haitao Pan <manbuzhe2009@qq.com>
2026-06-30 13:59:47 +08:00
d130ea31e2
fix(macos): generate matching WebRTC framework dSYM (#68)
Co-authored-by: Haitao Pan <manbuzhe2009@qq.com>
2026-06-30 13:24:04 +08:00
1666cbabe7
chore: resolve merge conflict in pubspec.yaml (#67)
Co-authored-by: Haitao Pan <manbuzhe2009@qq.com>
2026-06-30 12:07:32 +08:00
2295960a74
chore: resolve merge conflict in pubspec.yaml (#66)
Co-authored-by: Haitao Pan <manbuzhe2009@qq.com>
2026-06-30 12:05:51 +08:00
08ba6e30f7
fix(macos): workaround App Store Connect dSYM validation bug (#62)
* fix(macos): workaround App Store Connect dSYM validation bug for App.framework

* test: mock device and package plugins and increase timeout

- Increase sync loop timeout in thread workspace binding test to avoid flakiness
- Mock device_info and package_info plugins for gateway runtime tests
- Update pubspec.yaml version

* test: fix missing plugin in runtime_controllers_settings_account_test

* build: make sync-version.sh auto-increment build number

---------

Co-authored-by: Haitao Pan <manbuzhe2009@qq.com>
2026-06-30 10:48:35 +08:00
6fb1441226
refactor: replace super_clipboard with pasteboard (drop cargokit/Rust) (#55)
* refactor: replace super_clipboard with pasteboard, drop cargokit/Rust

super_clipboard pulled in super_native_extensions (a Rust native layer
built via cargokit), whose precompiled-binary download from GitHub
release assets has been intermittently failing the build ("Connection
closed while receiving data"). It was used for exactly one feature -
reading a clipboard image into the composer - in a single file; the
other 12 imports were dead.

- Swap super_clipboard -> pasteboard (platform-channel, no Rust).
- Rewrite readClipboardImageAsXFileInternal() on Pasteboard.image
  (PNG bytes), collapsing three helpers into one.
- Remove 12 unused super_clipboard imports.
- Regenerated plugin registrants / lockfiles drop super_native_extensions.

Removes the Rust toolchain requirement and the flaky download entirely.
Text copy/paste already used Flutter's built-in Clipboard and is
unaffected.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* ci: keep TestFlight package release-only

---------

Co-authored-by: Haitao Pan <manbuzhe2009@qq.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-30 08:30:26 +08:00
9 changed files with 121 additions and 50 deletions

View File

@ -35,6 +35,10 @@ on:
description: "Build & upload TestFlight (macOS/iOS App Store) artifacts"
type: boolean
default: false
enable_github_release:
description: "Upload assets to GitHub Release"
type: boolean
default: true
permissions:
contents: read
@ -54,6 +58,7 @@ jobs:
contents: write
outputs:
should_release: ${{ steps.flags.outputs.should_release }}
github_release_enabled: ${{ steps.flags.outputs.github_release_enabled }}
testflight_enabled: ${{ steps.flags.outputs.testflight_enabled }}
release_tag: ${{ steps.meta.outputs.release_tag }}
release_title: ${{ steps.meta.outputs.release_title }}
@ -68,6 +73,7 @@ jobs:
id: flags
shell: bash
env:
ENABLE_GITHUB_RELEASE_INPUT: ${{ github.event.inputs.enable_github_release }}
ENABLE_TESTFLIGHT_INPUT: ${{ github.event.inputs.enable_testflight }}
ENABLE_TESTFLIGHT_VAR: ${{ vars.ENABLE_TESTFLIGHT }}
run: |
@ -77,6 +83,12 @@ jobs:
echo "should_release=false" >> "$GITHUB_OUTPUT"
fi
if [[ "${GITHUB_EVENT_NAME:-}" == "workflow_dispatch" && "${ENABLE_GITHUB_RELEASE_INPUT:-}" == "false" ]]; then
echo "github_release_enabled=false" >> "$GITHUB_OUTPUT"
else
echo "github_release_enabled=true" >> "$GITHUB_OUTPUT"
fi
# TestFlight is opt-in (default OFF). Enabled only when explicitly
# requested via the workflow_dispatch input or the ENABLE_TESTFLIGHT
# repo/org variable. Keeps missing Apple signing secrets from failing
@ -292,46 +304,9 @@ jobs:
path: ${{ matrix.artifact_paths }}
if-no-files-found: error
remote_contract:
name: Test - remote provider contract
runs-on: ubuntu-22.04
needs:
- build
# Test-stage quality gate: runs between build and release.
# continue-on-error keeps it skippable so a failure never blocks release.
continue-on-error: true
if: ${{ github.event_name != 'push' && github.event_name != 'pull_request' }}
steps:
- name: Checkout source
uses: actions/checkout@v7
- name: Load Vault secrets
id: vault
uses: hashicorp/vault-action@v4
with:
url: ${{ env.VAULT_ADDR }}
method: jwt
role: github-actions-xworkmate-app
jwtGithubAudience: vault
ignoreNotFound: true
secrets: |
kv/data/github-actions/xworkmate-app REVIEW_ACCOUNT_LOGIN_PASSWORD | REVIEW_ACCOUNT_LOGIN_PASSWORD
- name: Export remote contract secrets
run: echo "REVIEW_ACCOUNT_LOGIN_PASSWORD=${{ steps.vault.outputs.REVIEW_ACCOUNT_LOGIN_PASSWORD }}" >> "$GITHUB_ENV"
- name: Verify accounts to bridge provider contract
shell: bash
env:
REVIEW_ACCOUNT_BASE_URL: ${{ vars.REVIEW_ACCOUNT_BASE_URL }}
REVIEW_ACCOUNT_LOGIN_NAME: ${{ vars.REVIEW_ACCOUNT_LOGIN_NAME }}
run: bash ./scripts/ci/verify_remote_provider_contract.sh
release:
# always() so release waits for the remote_contract gate to finish but is
# never blocked by it being skipped (e.g. push events) or failing.
# build/prepare must still genuinely succeed.
if: ${{ always() && needs.prepare.outputs.should_release == 'true' && needs.prepare.result == 'success' && needs.build.result == 'success' }}
if: ${{ needs.prepare.outputs.should_release == 'true' && needs.prepare.result == 'success' && needs.build.result == 'success' }}
strategy:
fail-fast: false
matrix:
@ -354,7 +329,6 @@ jobs:
needs:
- prepare
- build
- remote_contract
steps:
- name: Checkout source
uses: actions/checkout@v7

View File

@ -2,9 +2,9 @@ name: xworkmate
description: "XWorkmate desktop-first AI workspace shell."
publish_to: 'none'
version: 1.1.5+1
build-date: 2026-06-28
build-id: 4e02107
version: 1.1.5+2
build-date: 2026-06-30
build-id: a876e3b0
environment:
sdk: ^3.11.0

View File

@ -1,8 +1,9 @@
#!/usr/bin/env bash
set -euo pipefail
# Generate the dSYM that App Store validation expects for the vendored
# objective_c native-asset framework after Xcode/CocoaPods embed it.
# Generate dSYMs that App Store validation expects for embedded frameworks.
# Some prebuilt dependencies, including WebRTC, do not ship a dSYM even though
# their Mach-O binaries contain UUIDs that App Store Connect requires.
if [[ "${CONFIGURATION:-}" != "Release" && "${CONFIGURATION:-}" != "Profile" ]]; then
exit 0
fi
@ -22,6 +23,22 @@ fi
mkdir -p "${DWARF_DSYM_FOLDER_PATH}"
dsym_matches_binary() {
local binary_path="$1"
local dsym_path="$2"
local binary_uuids dsym_uuids uuid
[[ -d "${dsym_path}" ]] || return 1
binary_uuids="$(xcrun dwarfdump --uuid "${binary_path}" 2>/dev/null || true)"
dsym_uuids="$(xcrun dwarfdump --uuid "${dsym_path}" 2>/dev/null || true)"
[[ -n "${binary_uuids}" && -n "${dsym_uuids}" ]] || return 1
while read -r uuid; do
[[ -z "${uuid}" ]] || grep -Fq "${uuid}" <<<"${dsym_uuids}" || return 1
done < <(awk '/^UUID:/ { print $2 }' <<<"${binary_uuids}")
}
for framework_path in "${frameworks_dir}"/*.framework; do
[[ -d "${framework_path}" ]] || continue
@ -29,10 +46,8 @@ for framework_path in "${frameworks_dir}"/*.framework; do
binary_path="${framework_path}/${framework_name}"
[[ -f "${binary_path}" ]] || continue
[[ "${framework_name}" == "objective_c" ]] || continue
dsym_path="${DWARF_DSYM_FOLDER_PATH}/${framework_name}.framework.dSYM"
if [[ -d "${dsym_path}" ]]; then
if dsym_matches_binary "${binary_path}" "${dsym_path}"; then
continue
fi
@ -40,7 +55,8 @@ for framework_path in "${frameworks_dir}"/*.framework; do
continue
fi
echo "Generating missing dSYM for ${framework_name}.framework"
echo "Generating missing or mismatched dSYM for ${framework_name}.framework"
rm -rf "${dsym_path}"
if ! xcrun dsymutil "${binary_path}" -o "${dsym_path}" >/dev/null 2>&1; then
echo "warning: Failed to generate dSYM for ${framework_name}.framework" >&2
rm -rf "${dsym_path}" || true

View File

@ -40,7 +40,10 @@ app_build_commit="${GIT_BUILD_COMMIT:-${BUILD_ID_LINE:-unknown}}"
tmp_dir="$(mktemp -d "${RUNNER_TEMP:-/tmp}/xworkmate-macos-app-store.XXXXXX")"
cleanup() {
local status=$?
rm -rf "$tmp_dir"
apple_run_cleanup
return "$status"
}
trap cleanup EXIT
@ -80,12 +83,15 @@ xcodebuild archive \
-scheme Runner \
-configuration Release \
-archivePath "$archive_path" \
-allowProvisioningUpdates \
-allowProvisioningDeviceRegistration \
DEVELOPMENT_TEAM="N3G9T67W78"
xcodebuild -exportArchive \
-archivePath "$archive_path" \
-exportPath "$DIST_DIR" \
-exportOptionsPlist "$export_options_path"
-exportOptionsPlist "$export_options_path" \
-allowProvisioningUpdates
if ! compgen -G "$DIST_DIR/*.pkg" >/dev/null; then
echo "No macOS TestFlight pkg was produced under $DIST_DIR" >&2

29
scripts/sync-version.sh Executable file
View File

@ -0,0 +1,29 @@
#!/bin/bash
set -e
if [ -n "$1" ]; then
TARGET_VERSION="$1"
else
# Extract current version from pubspec.yaml
CURRENT_VERSION=$(grep "^version: " pubspec.yaml | awk '{print $2}')
if [[ "$CURRENT_VERSION" == *"+"* ]]; then
BASE_VERSION=$(echo "$CURRENT_VERSION" | cut -d'+' -f1)
BUILD_NUM=$(echo "$CURRENT_VERSION" | cut -d'+' -f2)
NEXT_BUILD_NUM=$((BUILD_NUM + 1))
TARGET_VERSION="${BASE_VERSION}+${NEXT_BUILD_NUM}"
else
TARGET_VERSION="${CURRENT_VERSION}+1"
fi
fi
DATE=$(date +%Y-%m-%d)
COMMIT=$(git rev-parse --short HEAD)
# Update version in pubspec.yaml
sed -i.bak -e "s/^version: .*/version: ${TARGET_VERSION}/" \
-e "s/^build-date: .*/build-date: ${DATE}/" \
-e "s/^build-id: .*/build-id: ${COMMIT}/" pubspec.yaml
rm -f pubspec.yaml.bak
echo "Updated pubspec.yaml to version=${TARGET_VERSION}, build-date=${DATE}, build-id=${COMMIT}"

41
test/mock_plugins.dart Normal file
View File

@ -0,0 +1,41 @@
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
void mockPlugins() {
TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger
.setMockMethodCallHandler(
const MethodChannel('dev.fluttercommunity.plus/package_info'),
(MethodCall methodCall) async {
return {
'appName': 'XWorkmate',
'packageName': 'com.xevor.xworkmate',
'version': '1.1.5',
'buildNumber': '1',
};
},
);
TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger
.setMockMethodCallHandler(
const MethodChannel('dev.fluttercommunity.plus/device_info'),
(MethodCall methodCall) async {
return {
'computerName': 'Test-Mac',
'hostName': 'Test-Mac',
'arch': 'arm64',
'model': 'MacBookPro18,1',
'kernelVersion': 'Darwin 21.4.0',
'osRelease': '21.4.0',
'activeCPUs': 10,
'memorySize': 34359738368,
'cpuFrequency': 3200000000,
};
},
);
TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger
.setMockMethodCallHandler(
const MethodChannel('plugins.flutter.io/path_provider'),
(MethodCall methodCall) async {
return '/tmp';
},
);
}

View File

@ -1230,7 +1230,7 @@ void main() {
);
for (
var attempt = 0;
attempt < 300 &&
attempt < 1000 &&
controller
.requireTaskThreadForSessionInternal('unit-fixture-task-a')
.lastArtifactSyncStatus !=

View File

@ -1,3 +1,4 @@
import "../mock_plugins.dart";
import 'dart:convert';
import 'dart:io';
@ -11,6 +12,7 @@ import 'package:xworkmate/runtime/secure_config_store.dart';
void main() {
TestWidgetsFlutterBinding.ensureInitialized();
mockPlugins();
HttpOverrides.global = null;
test(

View File

@ -1,3 +1,4 @@
import "../mock_plugins.dart";
import 'dart:convert';
import 'dart:io';
@ -9,6 +10,8 @@ import 'package:xworkmate/runtime/runtime_models.dart';
import 'package:xworkmate/runtime/secure_config_store.dart';
void main() {
TestWidgetsFlutterBinding.ensureInitialized();
mockPlugins();
group('SettingsController account sync', () {
test(
'prefers managed bridge token over stale profile token for remote gateway auth',