Skip to content

Commit

Permalink
Add MacOS Arm64
Browse files Browse the repository at this point in the history
  • Loading branch information
Syer10 committed Mar 30, 2024
1 parent 0ddef98 commit 54e2fdc
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 10 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/Build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,14 @@ jobs:

- runtime: osx-x64
arch: x64
os: macOS-latest
os: macOS-12
shell: bash
build: packageReleaseUberJarForCurrentOS packageReleaseDmg notarizeReleaseDmg
setupCl: ./scripts/SetupClUnix.sh

- runtime: osx-arm64
arch: aarch64
os: macOS-14
shell: bash
build: packageReleaseUberJarForCurrentOS packageReleaseDmg notarizeReleaseDmg
setupCl: ./scripts/SetupClUnix.sh
Expand Down Expand Up @@ -68,7 +75,7 @@ jobs:

- name: Setup MacOS Keychain
uses: apple-actions/import-codesign-certs@v2
if: ${{ matrix.runtime == 'osx-x64' }}
if: ${{ matrix.runtime == 'osx-x64' || matrix.runtime == 'osx-arm64' }}
with:
p12-file-base64: ${{ secrets.APPLE_CERT }}
p12-password: ${{ secrets.APPLE_CERT_PASSWORD }}
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/Preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ jobs:
build: packageReleaseUberJarForCurrentOS packageReleaseDmg notarizeReleaseDmg
setupCl: ./scripts/SetupClUnix.sh

- runtime: osx-arm64
arch: aarch64
os: macOS-14
shell: bash
build: packageReleaseUberJarForCurrentOS packageReleaseDmg notarizeReleaseDmg
setupCl: ./scripts/SetupClUnix.sh

- runtime: win-x64
arch: x64
os: windows-latest
Expand Down Expand Up @@ -68,7 +75,7 @@ jobs:

- name: Setup MacOS Keychain
uses: apple-actions/import-codesign-certs@v2
if: ${{ matrix.runtime == 'osx-x64' }}
if: ${{ matrix.runtime == 'osx-x64' || matrix.runtime == 'osx-arm64' }}
with:
p12-file-base64: ${{ secrets.APPLE_CERT }}
p12-password: ${{ secrets.APPLE_CERT_PASSWORD }}
Expand Down
24 changes: 17 additions & 7 deletions scripts/NamingFix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,25 @@ if [ -f "$msi" ]; then
fi
fi

dmg="$(find ./ -iname '*.dmg' 2>/dev/null)"
if [ -f "$dmg" ]; then
dir="$(dirname "$dmg")"
version=$(tmp="${dmg%.*}" && echo "${tmp##*-}")
# Find DMG
dmg_dirs="$(find ./ -type d -iname '*-macos-*' 2>/dev/null)"
for dir in $dmg_dirs; do
arch=$(basename "$dir" | cut -d'-' -f3) # Extract architecture from directory name
dmg="$dir/*.dmg"
if [ "$(ls -A $dir/*.dmg 2>/dev/null)" ]; then
version=$(tmp=$(basename $dir/*.dmg .dmg) && echo "${tmp##*-}")

if [ "$(basename "$dmg")" != "$name-macos-x64-$version.dmg" ]; then
mv "$dmg" "$dir/$name-macos-x64-$version.dmg"
if [ "$arch" == "x64" ]; then
if [ "$(basename $dir/*.dmg)" != "$name-macos-x64-$version.dmg" ]; then
mv $dir/*.dmg "$dir/$name-macos-x64-$version.dmg"
fi
elif [ "$arch" == "arm64" ]; then
if [ "$(basename $dir/*.dmg)" != "$name-macos-arm64-$version.dmg" ]; then
mv $dir/*.dmg "$dir/$name-macos-arm64-$version.dmg"
fi
fi
fi
fi
done

apk="$(find ./ -iname '*.apk' 2>/dev/null)"
if [ -f "$apk" ]; then
Expand Down

0 comments on commit 54e2fdc

Please sign in to comment.