-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (56 loc) · 1.86 KB
/
pr-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Pull Request Test
on:
pull_request:
branches: [ "main" ] # 监听针对 main 分支的 PR
jobs:
build-and-test:
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Build
run: |
xcodebuild clean build \
-project MacMusicPlayer.xcodeproj \
-scheme MacMusicPlayer \
-configuration Release \
-sdk macosx \
-destination 'generic/platform=macOS,name=Any Mac' \
-derivedDataPath build \
CODE_SIGN_IDENTITY="" \
CODE_SIGNING_REQUIRED=NO \
ONLY_ACTIVE_ARCH=NO \
ARCHS="x86_64 arm64"
- name: Verify Architectures
run: |
# 定义构建的应用程序路径
APP_PATH="build/Build/Products/Release/MacMusicPlayer.app"
echo "App Path: $APP_PATH"
# 检查应用程序是否存在
if [ ! -d "$APP_PATH" ]; then
echo "Error: Application not found at $APP_PATH"
exit 1
fi
# 查找可执行文件的路径
EXECUTABLE_PATH="$APP_PATH/Contents/MacOS/MacMusicPlayer"
echo "Executable Path: $EXECUTABLE_PATH"
# 显示可执行文件的架构信息
lipo -info "$EXECUTABLE_PATH"
# 验证是否支持 x86_64 架构
if lipo -info "$EXECUTABLE_PATH" | grep -q "x86_64"; then
echo "x86_64 architecture is supported."
else
echo "Error: x86_64 architecture is not supported!"
exit 1
fi
# 验证是否支持 arm64 架构
if lipo -info "$EXECUTABLE_PATH" | grep -q "arm64"; then
echo "arm64 architecture is supported."
else
echo "Error: arm64 architecture is not supported!"
exit 1
fi