Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions .github/workflows/publish-on-maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,14 @@ jobs:
matrix:
include:
- os: ubuntu-latest
command: bash linuxlib/build.sh
command: |
cd linuxlib && bash build.sh
- os: macos-latest
command: bash maclib/build.sh
command: |
cd maclib && bash build.sh
- os: windows-latest
command: cmd /c winlib/build.bat
command: |
cd winlib && cmd /c build.bat

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -48,7 +51,7 @@ jobs:
- name: Download all native binaries
uses: actions/download-artifact@v4
with:
name: nativeLibs-*
pattern: nativeLibs-*
path: ${{ env.NATIVE_LIBS_DIR }}
merge-multiple: true

Expand Down
12 changes: 9 additions & 3 deletions maclib/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,15 @@ set -e

echo "Building MacTray library..."

OUTPUT_DIR="${NATIVE_LIBS_OUTPUT_DIR}"
echo "output dir for mac is: $OUTPUT_DIR"

echo "Building for ARM64 (Apple Silicon)..."

swiftc -emit-library -o ../src/commonMain/resources/darwin-aarch64/libMacTray.dylib \
mkdir -p "$OUTPUT_DIR/darwin-aarch64"
mkdir -p "$OUTPUT_DIR/darwin-x86-64"

swiftc -emit-library -o "$OUTPUT_DIR/darwin-aarch64/libMacTray.dylib" \
-module-name MacTray \
-swift-version 5 \
-target arm64-apple-macosx11.0 \
Expand All @@ -20,7 +26,7 @@ swiftc -emit-library -o ../src/commonMain/resources/darwin-aarch64/libMacTray.dy

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

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

echo "Build completed successfully."
echo "Build completed successfully."