Skip to content

Commit e174ba1

Browse files
committed
fix github ci, update macos app name
1 parent f0fc3e3 commit e174ba1

File tree

3 files changed

+18
-28
lines changed

3 files changed

+18
-28
lines changed

.github/workflows/release.yml

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,11 @@ jobs:
2525
uses: actions/checkout@v4
2626

2727
- name: Get version from pubspec.yaml
28-
id: get_version
28+
id: get-version
2929
run: |
3030
VERSION=$(sed -n 's/^version: \([0-9]*\.[0-9]*\.[0-9]*\).*/\1/p' app/pubspec.yaml)
3131
echo "version=$VERSION" >> $GITHUB_OUTPUT
32+
echo "current version is $VERSION"
3233
3334
build-macos-arm64-lib:
3435
needs:
@@ -44,11 +45,9 @@ jobs:
4445
go-version: ${{ env.GO_VERSION }}
4546

4647
- name: Build dylib
47-
env:
48-
VERSION: ${{ needs.get-version.outputs.version }}
4948
run: |
5049
cd server
51-
go build -ldflags="-w -s -X github.com/honmaple/maple-file/server/internal/app.VERSION=$env:VERSION" -buildmode=c-shared -o libserver.dylib github.com/honmaple/maple-file/server/cmd/desktop
50+
go build -ldflags="-w -s -X github.com/honmaple/maple-file/server/internal/app.VERSION=${{ needs.get-version.outputs.version }}" -buildmode=c-shared -o libserver.dylib github.com/honmaple/maple-file/server/cmd/desktop
5251
5352
- name: Upload dylib
5453
uses: actions/upload-artifact@v4
@@ -92,12 +91,9 @@ jobs:
9291
path: server/arm64
9392

9493
- name: Build amd64 dylib
95-
env:
96-
VERSION: ${{ needs.get-version.outputs.version }}
9794
run: |
9895
cd server
99-
100-
go build -ldflags="-w -s -X github.com/honmaple/maple-file/server/internal/app.VERSION=$env:VERSION" -buildmode=c-shared -o libserver.dylib github.com/honmaple/maple-file/server/cmd/desktop
96+
go build -ldflags="-w -s -X github.com/honmaple/maple-file/server/internal/app.VERSION=${{ needs.get-version.outputs.version }}" -buildmode=c-shared -o libserver.dylib github.com/honmaple/maple-file/server/cmd/desktop
10197
10298
- name: Create dylib
10399
run: |
@@ -109,8 +105,6 @@ jobs:
109105
lipo -create -output libserver.dylib amd64-lib arm64-lib
110106
111107
- name: Build dmg
112-
env:
113-
VERSION: ${{ needs.get-version.outputs.version }}
114108
run: |
115109
cd app
116110
flutter pub get
@@ -120,8 +114,9 @@ jobs:
120114
cd build/macos/Build/Products/Release
121115
cat>appdmg.json<<EOF
122116
{
123-
"title": "maple_file",
117+
"title": "红枫云盘",
124118
"icon": "maple_file.app/Contents/Resources/AppIcon.icns",
119+
"background-color": "#ffffff",
125120
"contents": [
126121
{ "x": 448, "y": 344, "type": "link", "path": "/Applications" },
127122
{ "x": 192, "y": 344, "type": "file", "path": "maple_file.app" }
@@ -130,7 +125,7 @@ jobs:
130125
EOF
131126
132127
mkdir dist
133-
appdmg appdmg.json dist/maple-file-$VERSION-macos.dmg
128+
appdmg appdmg.json dist/maple-file-${{ needs.get-version.outputs.version }}-macos.dmg
134129
135130
- name: Upload dmg file
136131
uses: actions/upload-artifact@v4
@@ -164,30 +159,26 @@ jobs:
164159
flutter-version: ${{ env.FLUTTER_VERSION }}
165160

166161
- name: Build Go aar
167-
env:
168-
VERSION: ${{ needs.get-version.outputs.version }}
169162
run: |
170163
mkdir app/android/app/libs
171164
172165
cd server
173166
go install golang.org/x/mobile/cmd/gomobile@latest
174167
go get golang.org/x/mobile/bind
175168
gomobile init
176-
gomobile bind -ldflags="-w -s -X github.com/honmaple/maple-file/server/internal/app.VERSION=$env:VERSION" -o ../app/android/app/libs/server.aar -target=android -androidapi 21 -javapkg="com.honmaple.maple_file" github.com/honmaple/maple-file/server/cmd/mobile
169+
gomobile bind -ldflags="-w -s -X github.com/honmaple/maple-file/server/internal/app.VERSION=${{ needs.get-version.outputs.version }}" -o ../app/android/app/libs/server.aar -target=android -androidapi 21 -javapkg="com.honmaple.maple_file" github.com/honmaple/maple-file/server/cmd/mobile
177170
178171
- name: Build APK
179-
env:
180-
VERSION: ${{ needs.get-version.outputs.version }}
181172
run: |
182173
cd app
183174
flutter pub get
184175
dart run build_runner build
185176
flutter build apk --no-tree-shake-icons --split-per-abi
186177
187178
cd build/app/outputs/flutter-apk
188-
mv app-x86_64-release.apk maple-file-$VERSION-android-x86_64.apk
189-
mv app-arm64-v8a-release.apk maple-file-$VERSION-android-arm64-v8a.apk
190-
mv app-armeabi-v7a-release.apk maple-file-$VERSION-android-armeabi-v7a.apk
179+
mv app-x86_64-release.apk maple-file-${{ needs.get-version.outputs.version }}-android-x86_64.apk
180+
mv app-arm64-v8a-release.apk maple-file-${{ needs.get-version.outputs.version }}-android-arm64-v8a.apk
181+
mv app-armeabi-v7a-release.apk maple-file-${{ needs.get-version.outputs.version }}-android-armeabi-v7a.apk
191182
192183
- name: Upload APK
193184
uses: actions/upload-artifact@v4

app/lib/api/setting/providers/service.dart

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,9 @@ class SystemService {
3030
}
3131

3232
Future<String> getSetting(String key) async {
33-
final result = await doFuture(() async {
34-
GetSettingRequest request = GetSettingRequest(key: key);
35-
GetSettingResponse response = await _client.getSetting(request);
36-
return response.result.value;
37-
});
38-
return result ?? "";
33+
GetSettingRequest request = GetSettingRequest(key: key);
34+
GetSettingResponse response = await _client.getSetting(request);
35+
return response.result.value;
3936
}
4037

4138
Future<void> updateSetting(String key, Object? value) {

app/macos/Runner/Release.entitlements

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@
44
<dict>
55
<key>com.apple.security.app-sandbox</key>
66
<true/>
7+
<key>com.apple.security.network.server</key>
8+
<true/>
79
<key>com.apple.security.network.client</key>
810
<true/>
9-
<key>com.apple.security.files.user-selected.read-only</key>
10-
<true/>
11+
<key>com.apple.security.files.user-selected.read-write</key>
12+
<true/>
1113
</dict>
1214
</plist>

0 commit comments

Comments
 (0)