diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml
index 1c5ba3a9..b4efe61d 100644
--- a/.github/release-drafter.yml
+++ b/.github/release-drafter.yml
@@ -51,14 +51,22 @@ template: |
π₯ |
- | π MacOS |
- DMG |
+ π MacOS |
+ DMG |
universal |
π₯ |
+
+ | amd64 |
+ π₯ |
+
+
+ | arm64 |
+ π₯ |
+
| π§ Linux |
- Flathub | Flathub
amd64 |
π₯ |
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index d590781c..6b73efa1 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -139,9 +139,9 @@ jobs:
upload_url: ${{ needs.get-release.outputs.upload_url }}
asset_path: ui/flutter/build/windows/Output/*
overwrite: true
- build-macos-arm64-lib:
+ build-macos-amd64-lib:
if: ${{ github.event.inputs.platform == 'all' || github.event.inputs.platform == 'macos' }}
- runs-on: macos-latest
+ runs-on: macos-13
needs: [get-release]
steps:
- uses: actions/checkout@v3
@@ -157,15 +157,18 @@ jobs:
go build -ldflags="-w -s" github.com/GopeedLab/gopeed/cmd/updater
- uses: actions/upload-artifact@v4
with:
- name: macos-arm64-lib
+ name: macos-amd64-lib
path: |
libgopeed.dylib
host
updater
build-macos:
if: ${{ github.event.inputs.platform == 'all' || github.event.inputs.platform == 'macos' }}
- runs-on: macos-13
- needs: [get-release, build-macos-arm64-lib]
+ runs-on: macos-latest
+ strategy:
+ matrix:
+ channel: [ arm64, amd64, universal ]
+ needs: [get-release, build-macos-amd64-lib]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
@@ -183,34 +186,46 @@ jobs:
npm install -g appdmg
- uses: actions/download-artifact@v4
with:
- name: macos-arm64-lib
- path: ui/flutter/lib-arm64
+ name: macos-amd64-lib
+ path: ui/flutter/lib-amd64
+ - if: ${{ matrix.channel == 'arm64' }}
+ name: Build Arm64 Libraries
+ run: |
+ go build -tags nosqlite -ldflags="-w -s -X github.com/GopeedLab/gopeed/pkg/base.Version=$VERSION" -buildmode=c-shared -o ui/flutter/macos/Frameworks/libgopeed.dylib github.com/GopeedLab/gopeed/bind/desktop
+ go build -ldflags="-w -s" -o ui/flutter/assets/exec/host github.com/GopeedLab/gopeed/cmd/host
+ go build -ldflags="-w -s" -o ui/flutter/assets/exec/updater github.com/GopeedLab/gopeed/cmd/updater
+ - if: ${{ matrix.channel == 'amd64' }}
+ name: Build Amd64 Libraries
+ run: |
+ mkdir -p ui/flutter/macos/Frameworks
+
+ cp ui/flutter/lib-amd64/libgopeed.dylib ui/flutter/macos/Frameworks/libgopeed.dylib
+ cp ui/flutter/lib-amd64/host ui/flutter/assets/exec/host
+ cp ui/flutter/lib-amd64/updater ui/flutter/assets/exec/updater
+ - if: ${{ matrix.channel == 'universal' }}
+ name: Build Universal Libraries
+ run: |
+ mkdir -p ui/flutter/macos/Frameworks
+
+ # arm64 lib
+ go build -tags nosqlite -ldflags="-w -s -X github.com/GopeedLab/gopeed/pkg/base.Version=$VERSION" -buildmode=c-shared -o ui/flutter/.temp/libgopeed.dylib.arm64 github.com/GopeedLab/gopeed/bind/desktop
+ go build -ldflags="-w -s" -o ui/flutter/.temp/host.arm64 github.com/GopeedLab/gopeed/cmd/host
+ go build -ldflags="-w -s" -o ui/flutter/.temp/updater.arm64 github.com/GopeedLab/gopeed/cmd/updater
+
+ # amd64 lib
+ cp ui/flutter/lib-amd64/libgopeed.dylib ui/flutter/.temp/libgopeed.dylib.amd64
+ cp ui/flutter/lib-amd64/host ui/flutter/.temp/host.amd64
+ cp ui/flutter/lib-amd64/updater ui/flutter/.temp/updater.amd64
+
+ # universal lib
+ lipo -create -output ui/flutter/macos/Frameworks/libgopeed.dylib ui/flutter/.temp/libgopeed.dylib.arm64 ui/flutter/.temp/libgopeed.dylib.amd64
+ lipo -create -output ui/flutter/assets/exec/host ui/flutter/.temp/host.arm64 ui/flutter/.temp/host.amd64
+ lipo -create -output ui/flutter/assets/exec/updater ui/flutter/.temp/updater.arm64 ui/flutter/.temp/updater.amd64
- name: Build
env:
VERSION: ${{ needs.get-release.outputs.version }}
run: |
- PROJECT_DIR=$(pwd)
-
- # amd64 lib
- go build -tags nosqlite -ldflags="-w -s -X github.com/GopeedLab/gopeed/pkg/base.Version=$VERSION" -buildmode=c-shared -o ui/flutter/lib-amd64/libgopeed.dylib github.com/GopeedLab/gopeed/bind/desktop
- go build -ldflags="-w -s" -o ui/flutter/lib-amd64/host github.com/GopeedLab/gopeed/cmd/host
- go build -ldflags="-w -s" -o ui/flutter/lib-amd64/updater github.com/GopeedLab/gopeed/cmd/updater
- # universal binary
- mkdir -p ui/flutter/macos/Frameworks
- cp ui/flutter/lib-amd64/libgopeed.dylib ui/flutter/macos/Frameworks/amd64-lib
- cp ui/flutter/lib-arm64/libgopeed.dylib ui/flutter/macos/Frameworks/arm64-lib
- cp ui/flutter/lib-amd64/host ui/flutter/macos/Frameworks/amd64-host
- cp ui/flutter/lib-arm64/host ui/flutter/macos/Frameworks/arm64-host
- cp ui/flutter/lib-amd64/updater ui/flutter/macos/Frameworks/amd64-updater
- cp ui/flutter/lib-arm64/updater ui/flutter/macos/Frameworks/arm64-updater
- cd ui/flutter/macos/Frameworks
- lipo -create -output libgopeed.dylib amd64-lib arm64-lib
- lipo -create -output host amd64-host arm64-host
- lipo -create -output updater amd64-updater arm64-updater
- rm -rf amd64-lib arm64-lib amd64-host arm64-host amd64-updater arm64-updater
- mv host ../../assets/exec/host
-
- cd $PROJECT_DIR/ui/flutter
+ cd ui/flutter
flutter build macos --dart-define="UPDATE_CHANNEL=macosDmg"
cd build/macos/Build/Products/Release
cat>appdmg.json<π₯
- | π MacOS |
- DMG |
+ π MacOS |
+ DMG |
universal |
π₯ |
+
+ | amd64 |
+ π₯ |
+
+
+ | arm64 |
+ π₯ |
+
| π§ Linux |
Flathub |
diff --git a/README_ja-JP.md b/README_ja-JP.md
index 5a4bd303..9b1b74dc 100644
--- a/README_ja-JP.md
+++ b/README_ja-JP.md
@@ -35,11 +35,19 @@ Gopeed (ζ£εΌε Go Speed) γ― `Golang` + `Flutter` γ«γγ£γ¦ιηΊγγγ
π₯ |
- | π MacOS |
- DMG |
+ π MacOS |
+ DMG |
universal |
π₯ |
+
+ | amd64 |
+ π₯ |
+
+
+ | arm64 |
+ π₯ |
+
| π§ Linux |
Flathub |
diff --git a/README_vi-VN.md b/README_vi-VN.md
index 82dc40f9..0098e6f0 100644
--- a/README_vi-VN.md
+++ b/README_vi-VN.md
@@ -35,11 +35,19 @@ Truy cαΊp β [Trang web chΓnh thα»©c](https://gopeed.com) | π [TΓ i liα»u
π₯ |
- | π MacOS |
- DMG |
+ π MacOS |
+ DMG |
universal |
π₯ |
+
+ | amd64 |
+ π₯ |
+
+
+ | arm64 |
+ π₯ |
+
| π§ Linux |
Flathub |
diff --git a/README_zh-CN.md b/README_zh-CN.md
index 49787907..eac548bc 100644
--- a/README_zh-CN.md
+++ b/README_zh-CN.md
@@ -35,11 +35,19 @@ GopeedοΌε
¨η§° Go SpeedοΌοΌη΄θ―θΏζ₯δΈζεε«ε`ε€εΏ«δΈθ½½ε¨`οΌδΈ
π₯ |
- | π MacOS |
- DMG |
+ π MacOS |
+ DMG |
universal |
π₯ |
+
+ | amd64 |
+ π₯ |
+
+
+ | arm64 |
+ π₯ |
+
| π§ Linux |
Flathub |
diff --git a/README_zh-TW.md b/README_zh-TW.md
index c978985f..c13d5a88 100644
--- a/README_zh-TW.md
+++ b/README_zh-TW.md
@@ -35,11 +35,19 @@ GopeedοΌε
¨η¨± Go SpeedοΌοΌζ―δΈζ¬Ύδ½Ώη¨`Golang`+`Flutter`η·¨ε―«ηι«ι
π₯ |
- | π MacOS |
- DMG |
+ π MacOS |
+ DMG |
universal |
π₯ |
+
+ | amd64 |
+ π₯ |
+
+
+ | arm64 |
+ π₯ |
+
| π§ Linux |
Flathub |
diff --git a/ui/flutter/lib/util/updater.dart b/ui/flutter/lib/util/updater.dart
index 80c119f3..d14d3412 100644
--- a/ui/flutter/lib/util/updater.dart
+++ b/ui/flutter/lib/util/updater.dart
@@ -406,7 +406,7 @@ String _getAssetName(String version) {
case Channel.windowsPortable:
return 'Gopeed-v$version-windows-${commonArchName()}-portable.zip';
case Channel.macosDmg:
- return 'Gopeed-v$version-macos.dmg';
+ return 'Gopeed-v$version-macos-${commonArchName()}.dmg';
case Channel.linuxDeb:
return 'Gopeed-v$version-linux-${commonArchName()}.deb';
case Channel.androidApk: