@@ -7,48 +7,52 @@ permissions:
77 contents : write
88 packages : write
99
10- env :
11- CARGO_TERM_COLOR : always
12-
1310jobs :
1411 macutil_build :
1512 runs-on : ubuntu-latest
1613
1714 steps :
1815 - uses : actions/checkout@v4
1916
20- - name : Install musl-tools
21- run : sudo apt-get update && sudo apt-get install musl-tools
22-
23- - name : Cache Cargo registry
24- uses : actions/cache@v4
17+ - name : Setup .NET
18+ uses : actions/setup-dotnet@v4
2519 with :
26- path : ~/.cargo/registry
27- key : ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
28- restore-keys : ${{ runner.os }}-cargo-registry-
20+ dotnet-version : ' 9.0.x'
2921
30- - name : Cache Cargo index
22+ - name : Cache .NET packages
3123 uses : actions/cache@v4
3224 with :
33- path : ~/.cargo/git
34- key : ${{ runner.os }}-cargo-index- ${{ hashFiles('**/Cargo .lock') }}
35- restore-keys : ${{ runner.os }}-cargo-index -
25+ path : ~/.nuget/packages
26+ key : ${{ runner.os }}-nuget- ${{ hashFiles('**/packages .lock.json ') }}
27+ restore-keys : ${{ runner.os }}-nuget -
3628
37- - name : Install Rust
38- uses : dtolnay/rust-toolchain@stable
39- with :
40- targets : x86_64-unknown-linux-musl
29+ - name : Restore dependencies
30+ run : dotnet restore MacUtilGUI/MacUtilGUI.fsproj
4131
42- - name : Install cross-rs for cross-compilation
43- run : cargo install cross
32+ - name : Build and publish macOS x64
33+ run : |
34+ dotnet publish MacUtilGUI/MacUtilGUI.fsproj \
35+ --configuration Release \
36+ --runtime osx-x64 \
37+ --self-contained true \
38+ --output ./build/osx-x64 \
39+ /p:PublishSingleFile=true \
40+ /p:IncludeNativeLibrariesForSelfExtract=true
4441
45- - name : Build x86_64 binary
46- run : cargo build --target-dir=build --release --verbose --target=x86_64-unknown-linux-musl --all-features
42+ - name : Build and publish macOS ARM64
43+ run : |
44+ dotnet publish MacUtilGUI/MacUtilGUI.fsproj \
45+ --configuration Release \
46+ --runtime osx-arm64 \
47+ --self-contained true \
48+ --output ./build/osx-arm64 \
49+ /p:PublishSingleFile=true \
50+ /p:IncludeNativeLibrariesForSelfExtract=true
4751
48- - name : Build aarch64 binary
52+ - name : Rename binaries
4953 run : |
50- cross build --target-dir=build --release --verbose --target=aarch64-unknown-linux-musl --all-features
51- mv ./build/aarch64-unknown-linux-musl/release/macutil ./build/aarch64-unknown-linux-musl/release/ macutil-aarch64
54+ mv ./ build/osx-x64/MacUtilGUI ./build/osx-x64/macutil-macos-x64
55+ mv ./build/osx-arm64/MacUtilGUI ./build/osx-arm64/ macutil-macos-arm64
5256
5357 - name : Extract Version
5458 id : extract_version
@@ -64,16 +68,14 @@ jobs:
6468 tag_name : ${{ env.version }}
6569 name : Pre-Release ${{ env.version }}
6670 body : |
67- 
68- 
71+ 
72+ 
6973
7074 append_body : true
7175 generate_release_notes : true
7276 files : |
73- ./build/x86_64-unknown-linux-musl/release/macutil
74- ./build/aarch64-unknown-linux-musl/release/macutil-aarch64
75- ./start.sh
76- ./startdev.sh
77+ ./build/osx-x64/macutil-macos-x64
78+ ./build/osx-arm64/macutil-macos-arm64
7779 prerelease : true
7880 env :
7981 version : ${{ env.version }}
0 commit comments