-
-
Notifications
You must be signed in to change notification settings - Fork 13
108 lines (101 loc) · 3.22 KB
/
build.yml
File metadata and controls
108 lines (101 loc) · 3.22 KB
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
name: Build
on:
pull_request:
workflow_dispatch:
jobs:
build-android:
name: Build for Android
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install Ninja
run: sudo apt-get install -y ninja-build
- uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: '21'
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
- run: flutter pub get
- name: Patch pdfrx
run: |
PDFRX_PATH=$(find $HOME/.pub-cache -type d -name "pdfium_flutter-*" | head -n 1)
CMAKE_FILE="$PDFRX_PATH/android/CMakeLists.txt"
if [ -f "$CMAKE_FILE" ]; then
sed -i '2i add_link_options("LINKER:--build-id=none")' "$CMAKE_FILE"
echo "Patched CMakeLists.txt in $CMAKE_FILE"
else
echo "CMakeLists.txt not found in expected location"
exit 1
fi
- run: dart run pdfrx:remove_wasm_modules
- name: Patch dartjni
run: |
JNI_CMAKE=$(find $HOME/.pub-cache/hosted/pub.dev -path "*/jni-*/src/CMakeLists.txt" | head -n 1)
if [ -n "$JNI_CMAKE" ] && [ -f "$JNI_CMAKE" ]; then
sed -i '2i add_link_options("LINKER:--build-id=none")' "$JNI_CMAKE"
echo "Patched CMakeLists.txt in $JNI_CMAKE"
else
echo "Error: jni CMakeLists.txt not found in expected location."
exit 1
fi
- run: flutter build apk --debug
- uses: actions/upload-artifact@v7
with:
name: android-debug-apk
path: build/app/outputs/apk/debug/app-debug.apk
build-ios:
name: Build for iOS
runs-on: macos-15
steps:
- uses: actions/checkout@v6
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
architecture: x64
- run: flutter pub get
- run: flutter build ios --debug --no-codesign
- uses: actions/upload-artifact@v7
with:
name: ios-debug-app
path: build/ios/iphoneos/*.app
build-macos:
name: Build for macOS
runs-on: macos-15
steps:
- uses: actions/checkout@v6
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
- run: flutter pub get
- name: Disable macOS code signing
run: |
echo "CODE_SIGNING_ALLOWED=NO" >> macos/Runner/Configs/Debug.xcconfig
echo "CODE_SIGNING_REQUIRED=NO" >> macos/Runner/Configs/Debug.xcconfig
echo "CODE_SIGN_IDENTITY=" >> macos/Runner/Configs/Debug.xcconfig
- run: flutter build macos --debug
- uses: actions/upload-artifact@v7
with:
name: macos-debug-app
path: build/macos/Build/Products/Debug/*.app
build-windows:
name: Build for Windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v6
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
- run: flutter pub get
- run: flutter build windows --debug
- uses: actions/upload-artifact@v7
with:
name: windows-debug
path: build/windows/x64/runner/Debug/