Universal MacOS build

This commit is contained in:
Hanh 2022-12-17 15:01:28 +08:00
parent 74b8c942fe
commit e796f74d3d
3 changed files with 63 additions and 14 deletions

View File

@ -1,4 +1,4 @@
name: Build and Release MacOS
name: Build and Release MacOS Universal
on:
workflow_dispatch:
@ -20,10 +20,14 @@ jobs:
curl https://download.z.cash/downloads/sapling-output.params --output $HOME/.zcash-params/sapling-output.params
curl https://download.z.cash/downloads/sapling-spend.params --output $HOME/.zcash-params/sapling-spend.params
- name: Build dylib
run: |
cargo install cargo-make
cargo make flatpak
- name: rustup
run: rustup target add aarch64-apple-darwin
- name: install make
run: cargo install cargo-make
- name: build lib
run: cargo make macos
- name: wget flutter
run: |
@ -41,11 +45,11 @@ jobs:
- name: Build DMG
run: |
npm install -g appdmg
(cd misc;appdmg app.json ../ywallet.dmg)
(cd misc;appdmg app.json ../ywallet-universal.dmg)
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/v')
with:
files: |
./ywallet.dmg
./ywallet-universal.dmg

View File

@ -297,9 +297,54 @@ args = [
"--features=dart_ffi"
]
[tasks.mac-build-release]
private = true
command = "cargo"
args = [
"build",
"--target=x86_64-apple-darwin",
"--release",
"--features=dart_ffi"
]
[tasks.m1-build-release]
private = true
command = "cargo"
args = [
"build",
"--target=aarch64-apple-darwin",
"--release",
"--features=dart_ffi"
]
[tasks.flatpak]
dependencies = [
"setup-crate-type-android",
"desktop-build-release",
"restore-crate-type"
]
[tasks.macos]
dependencies = [
"setup-crate-type-android",
"mac-build-release",
"m1-build-release",
"restore-crate-type",
"post-macos"
]
[tasks.post-macos]
script_runner = "@duckscript"
condition = { platforms = ["mac"] }
script = [
"mkdir ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/target/universal/release",
"""
exec /usr/bin/lipo ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/target/x86_64-apple-darwin/release/libwarp_api_ffi.dylib \
${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/target/aarch64-apple-darwin/release/libwarp_api_ffi.dylib \
-output ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/target/universal/release/libwarp_api_ffi.dylib -create
""",
"""
cp ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/native/${CARGO_MAKE_CRATE_CURRENT_WORKSPACE_MEMBER}/binding.h \
${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/packages/warp_api_ffi/ios/Classes/binding.h
""",
]

View File

@ -71,7 +71,7 @@
33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = "<group>"; };
33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = "<group>"; };
3ABAA4F74E9B840322C571A2 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
3B7C926528AE6FF000777DAD /* libwarp_api_ffi.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libwarp_api_ffi.dylib; path = ../target/release/libwarp_api_ffi.dylib; sourceTree = "<group>"; };
3B7C926528AE6FF000777DAD /* libwarp_api_ffi.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libwarp_api_ffi.dylib; path = ../target/universal/release/libwarp_api_ffi.dylib; sourceTree = "<group>"; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = "<group>"; };
8D0D09BA27FFDEBE0DB78C1C /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = "<group>"; };
@ -424,13 +424,13 @@
CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 300;
CURRENT_PROJECT_VERSION = 327;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
);
MARKETING_VERSION = 1.2.16;
MARKETING_VERSION = 1.2.17;
PRODUCT_BUNDLE_IDENTIFIER = me.hanh.ywallet;
PROVISIONING_PROFILE_SPECIFIER = "";
STRIP_STYLE = "non-global";
@ -554,13 +554,13 @@
CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 300;
CURRENT_PROJECT_VERSION = 327;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
);
MARKETING_VERSION = 1.2.16;
MARKETING_VERSION = 1.2.17;
PRODUCT_BUNDLE_IDENTIFIER = me.hanh.ywallet;
PROVISIONING_PROFILE_SPECIFIER = "";
STRIP_STYLE = "non-global";
@ -578,13 +578,13 @@
CODE_SIGN_ENTITLEMENTS = Runner/Release.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 300;
CURRENT_PROJECT_VERSION = 327;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
);
MARKETING_VERSION = 1.2.16;
MARKETING_VERSION = 1.2.17;
PRODUCT_BUNDLE_IDENTIFIER = me.hanh.ywallet;
PROVISIONING_PROFILE_SPECIFIER = "";
STRIP_STYLE = "non-global";