Compare commits
5 Commits
main
...
hotfix/mac
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
797c561c0d | ||
|
|
b6c64db6f8 | ||
|
|
d1bf9a76c8 | ||
|
|
9987c0cc9f | ||
|
|
a876e3b0e4 |
16
.github/workflows/build-and-release.yml
vendored
16
.github/workflows/build-and-release.yml
vendored
@ -31,6 +31,10 @@ on:
|
||||
- ".github/workflows/build-and-release.yml"
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
enable_github_release:
|
||||
description: "Upload assets to GitHub Release"
|
||||
type: boolean
|
||||
default: true
|
||||
enable_testflight:
|
||||
description: "Build & upload TestFlight (macOS/iOS App Store) artifacts"
|
||||
type: boolean
|
||||
@ -55,6 +59,7 @@ jobs:
|
||||
outputs:
|
||||
should_release: ${{ steps.flags.outputs.should_release }}
|
||||
testflight_enabled: ${{ steps.flags.outputs.testflight_enabled }}
|
||||
github_release_enabled: ${{ steps.flags.outputs.github_release_enabled }}
|
||||
release_tag: ${{ steps.meta.outputs.release_tag }}
|
||||
release_title: ${{ steps.meta.outputs.release_title }}
|
||||
release_notes: ${{ steps.meta.outputs.release_notes }}
|
||||
@ -70,6 +75,7 @@ jobs:
|
||||
env:
|
||||
ENABLE_TESTFLIGHT_INPUT: ${{ github.event.inputs.enable_testflight }}
|
||||
ENABLE_TESTFLIGHT_VAR: ${{ vars.ENABLE_TESTFLIGHT }}
|
||||
ENABLE_GITHUB_RELEASE_INPUT: ${{ github.event.inputs.enable_github_release }}
|
||||
run: |
|
||||
if [[ "${GITHUB_REF:-}" == refs/tags/v* || "${GITHUB_EVENT_NAME:-}" == "workflow_dispatch" || "${GITHUB_REF:-}" == "refs/heads/main" ]]; then
|
||||
echo "should_release=true" >> "$GITHUB_OUTPUT"
|
||||
@ -87,6 +93,12 @@ jobs:
|
||||
echo "testflight_enabled=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
|
||||
|
||||
- name: Compute release metadata
|
||||
id: meta
|
||||
shell: bash
|
||||
@ -392,13 +404,13 @@ jobs:
|
||||
} >> "$GITHUB_ENV"
|
||||
|
||||
- name: Download all artifacts
|
||||
if: ${{ matrix.target == 'github_release' }}
|
||||
if: ${{ matrix.target == 'github_release' && needs.prepare.outputs.github_release_enabled == 'true' }}
|
||||
uses: actions/download-artifact@v8
|
||||
with:
|
||||
path: release-artifacts
|
||||
|
||||
- name: Upload assets to GitHub Release
|
||||
if: ${{ matrix.target == 'github_release' }}
|
||||
if: ${{ matrix.target == 'github_release' && needs.prepare.outputs.github_release_enabled == 'true' }}
|
||||
shell: bash
|
||||
run: bash ./scripts/ci/github_release_upload.sh release-artifacts
|
||||
env:
|
||||
|
||||
@ -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: a876e3b
|
||||
|
||||
environment:
|
||||
sdk: ^3.11.0
|
||||
|
||||
@ -46,3 +46,11 @@ for framework_path in "${frameworks_dir}"/*.framework; do
|
||||
rm -rf "${dsym_path}" || true
|
||||
fi
|
||||
done
|
||||
|
||||
# Workaround for App Store Connect bug where it expects the DWARF file for App.framework to be named "A"
|
||||
# because the binary is located at App.framework/Versions/A/App.
|
||||
app_dwarf_dir="${DWARF_DSYM_FOLDER_PATH}/App.framework.dSYM/Contents/Resources/DWARF"
|
||||
if [[ -d "${app_dwarf_dir}" && -f "${app_dwarf_dir}/App" && ! -f "${app_dwarf_dir}/A" ]]; then
|
||||
echo "Applying workaround: Copying App DWARF file to A for App Store Connect validation"
|
||||
cp "${app_dwarf_dir}/App" "${app_dwarf_dir}/A"
|
||||
fi
|
||||
|
||||
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