Skip to content

Commit 23182f5

Browse files
authored
Merge pull request #343 from amir1376/fix/maclib-build
Fix the build-native job and update the maclib/build.sh
2 parents 93b5dcf + a339bb8 commit 23182f5

2 files changed

Lines changed: 16 additions & 7 deletions

File tree

.github/workflows/publish-on-maven.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,14 @@ jobs:
1515
matrix:
1616
include:
1717
- os: ubuntu-latest
18-
command: bash linuxlib/build.sh
18+
command: |
19+
cd linuxlib && bash build.sh
1920
- os: macos-latest
20-
command: bash maclib/build.sh
21+
command: |
22+
cd maclib && bash build.sh
2123
- os: windows-latest
22-
command: cmd /c winlib/build.bat
24+
command: |
25+
cd winlib && cmd /c build.bat
2326
2427
steps:
2528
- uses: actions/checkout@v4
@@ -48,7 +51,7 @@ jobs:
4851
- name: Download all native binaries
4952
uses: actions/download-artifact@v4
5053
with:
51-
name: nativeLibs-*
54+
pattern: nativeLibs-*
5255
path: ${{ env.NATIVE_LIBS_DIR }}
5356
merge-multiple: true
5457

maclib/build.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,15 @@ set -e
55

66
echo "Building MacTray library..."
77

8+
OUTPUT_DIR="${NATIVE_LIBS_OUTPUT_DIR}"
9+
echo "output dir for mac is: $OUTPUT_DIR"
10+
811
echo "Building for ARM64 (Apple Silicon)..."
912

10-
swiftc -emit-library -o ../src/commonMain/resources/darwin-aarch64/libMacTray.dylib \
13+
mkdir -p "$OUTPUT_DIR/darwin-aarch64"
14+
mkdir -p "$OUTPUT_DIR/darwin-x86-64"
15+
16+
swiftc -emit-library -o "$OUTPUT_DIR/darwin-aarch64/libMacTray.dylib" \
1117
-module-name MacTray \
1218
-swift-version 5 \
1319
-target arm64-apple-macosx11.0 \
@@ -20,7 +26,7 @@ swiftc -emit-library -o ../src/commonMain/resources/darwin-aarch64/libMacTray.dy
2026

2127
echo "Building for x86_64 (Intel)..."
2228

23-
swiftc -emit-library -o ../src/commonMain/resources/darwin-x86-64/libMacTray.dylib \
29+
swiftc -emit-library -o "$OUTPUT_DIR/darwin-x86-64/libMacTray.dylib" \
2430
-module-name MacTray \
2531
-swift-version 5 \
2632
-target x86_64-apple-macosx11.0 \
@@ -31,4 +37,4 @@ swiftc -emit-library -o ../src/commonMain/resources/darwin-x86-64/libMacTray.dyl
3137
-Xlinker -rpath -Xlinker @loader_path/Frameworks \
3238
tray.swift
3339

34-
echo "Build completed successfully."
40+
echo "Build completed successfully."

0 commit comments

Comments
 (0)