Skip to content

Commit

Permalink
[ci] Add universal mac builds
Browse files Browse the repository at this point in the history
  • Loading branch information
tobil4sk committed Jun 28, 2024
1 parent 971847d commit 6d1cf20
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,65 @@ jobs:
name: chocolatey
path: extra/chocolatey/pack/

mac-universal:
name: mac universal
needs: [mac-build]
runs-on: macos-latest

strategy:
matrix:
link_type: [static, dynamic]
include:
- link_type: static
name_suffix: -static

env:
INPUT_AMD64: mac${{ matrix.name_suffix }}-amd64-binaries
INPUT_ARM64: mac${{ matrix.name_suffix }}-arm64-binaries
OUTPUT: mac${{ matrix.name_suffix }}-universal-binaries

steps:
- name: Download ${{ env.INPUT_AMD64 }}
uses: actions/download-artifact@v4
with:
name: ${{ env.INPUT_AMD64 }}
path: ${{ env.INPUT_AMD64 }}

- name: Download ${{ env.INPUT_ARM64 }}
uses: actions/download-artifact@v4
with:
name: ${{ env.INPUT_ARM64 }}
path: ${{ env.INPUT_ARM64 }}

- name: Create universal binaries
run: |
mkdir $OUTPUT
# put amd64 files straight into output to make sure all non-binary files are also included
tar -xf $INPUT_AMD64/neko-*.tar.gz \
-C $OUTPUT --strip-components=1
tar -xf $INPUT_ARM64/neko-*.tar.gz \
-C $INPUT_ARM64 --strip-components=1
for filename in $OUTPUT/{*.ndll,*.dylib,neko,nekoc,nekoml,nekotools}; do
filename_amd64=$filename
filename_arm64=${filename/$OUTPUT/$INPUT_ARM64}
lipo -create -output $filename $filename_amd64 $filename_arm64
done
file *
- name: Check version
run: |
set -ex
[ "`./$OUTPUT/neko -version`" == "$NEKO_VERSION" ]
- name: Upload universal binaries
uses: actions/upload-artifact@v4
with:
name: ${{ env.OUTPUT }}
path: ${{ env.OUTPUT }}

deploy-s3:
name: deploy s3
needs: [windows-build, package-choco, mac-build, linux-build]
Expand Down

0 comments on commit 6d1cf20

Please sign in to comment.