Compare commits
5 Commits
hotfix/mac
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| bd5bfb0f1e | |||
| d130ea31e2 | |||
| 1666cbabe7 | |||
| 2295960a74 | |||
| 08ba6e30f7 |
52
.github/workflows/build-and-release.yml
vendored
52
.github/workflows/build-and-release.yml
vendored
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
29
scripts/sync-version.sh
Executable 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
41
test/mock_plugins.dart
Normal 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';
|
||||
},
|
||||
);
|
||||
}
|
||||
@ -1230,7 +1230,7 @@ void main() {
|
||||
);
|
||||
for (
|
||||
var attempt = 0;
|
||||
attempt < 300 &&
|
||||
attempt < 1000 &&
|
||||
controller
|
||||
.requireTaskThreadForSessionInternal('unit-fixture-task-a')
|
||||
.lastArtifactSyncStatus !=
|
||||
|
||||
@ -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(
|
||||
|
||||
@ -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',
|
||||
|
||||
Loading…
Reference in New Issue
Block a user