Skip to content

Commit

Permalink
Build binaries for Mac OS M1 on GitHub Action
Browse files Browse the repository at this point in the history
Refs eng/ide/ada_language_server#1262
  • Loading branch information
reznikmm committed Dec 6, 2023
1 parent 212a2ca commit 65919f6
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 9 deletions.
25 changes: 17 additions & 8 deletions .github/workflows/build-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,33 @@ jobs:
exclude:
- os: windows-latest
cross: aarch64
- os: macos-11
cross: aarch64
runs-on: ${{ matrix.os }}
steps:
- run: git config --global core.autocrlf input
shell: bash
- name: Unpack cross toolchain from AWS S3
if: ${{ matrix.cross != '' }}
- name: Install cross toolchain (Linux)
if: ${{ matrix.cross != '' && runner.os == 'Linux' }}
env:
AWS_ACCESS_KEY_ID: ${{secrets.GHA_CACHE_ACCESS_KEY_ID}}
AWS_SECRET_ACCESS_KEY: ${{secrets.GHA_CACHE_SECRET}}
AWS_DEFAULT_REGION: eu-west-1
run: |
aws s3 cp s3://adacore-gha-tray-eu-west-1/libadalang/${{ matrix.cross }}-${{ runner.os }}-gcc-13.2.tar.bz2 . --sse=AES256
aws s3 cp s3://adacore-gha-tray-eu-west-1/libadalang/${{ matrix.cross }}-${{ runner.os }}-gmp-6.2.1.tar.bz2 . --sse=AES256
sudo apt install -y libc6-dev-arm64-cross linux-libc-dev-arm64-cross binutils-aarch64-linux-gnu
sudo tar xavf ${{ matrix.cross }}-${{ runner.os }}-gcc-13.2.tar.bz2 -C /
sudo tar xavf ${{ matrix.cross }}-${{ runner.os }}-gmp-6.2.1.tar.bz2 -C /
aws s3 cp s3://adacore-gha-tray-eu-west-1/toolchain/${{ matrix.cross }}-${{ runner.os }}-gcc-13.2.tar.bz2 . --sse=AES256
aws s3 cp s3://adacore-gha-tray-eu-west-1/toolchain/${{ matrix.cross }}-${{ runner.os }}-gmp-6.2.1.tar.bz2 . --sse=AES256
sudo tar xjf ${{ matrix.cross }}-${{ runner.os }}-gcc-13.2.tar.bz2 -C /
sudo tar xjf ${{ matrix.cross }}-${{ runner.os }}-gmp-6.2.1.tar.bz2 -C /
- name: Install cross toolchain (MacOS)
if: ${{ matrix.cross != '' && runner.os != 'Linux' }}
env:
AWS_ACCESS_KEY_ID: ${{secrets.GHA_CACHE_ACCESS_KEY_ID}}
AWS_SECRET_ACCESS_KEY: ${{secrets.GHA_CACHE_SECRET}}
AWS_DEFAULT_REGION: eu-west-1
run: |
aws s3 cp s3://adacore-gha-tray-eu-west-1/toolchain/${{ matrix.cross }}-${{ runner.os }}-gcc-13.2.tar.bz2 . --sse=AES256
aws s3 cp s3://adacore-gha-tray-eu-west-1/toolchain/${{ matrix.cross }}-${{ runner.os }}-gmp-6.2.1.tar.bz2 . --sse=AES256
sudo tar xjf ${{ matrix.cross }}-${{ runner.os }}-gcc-13.2.tar.bz2 --strip-components=3 -C /usr/local
sudo tar xjf ${{ matrix.cross }}-${{ runner.os }}-gmp-6.2.1.tar.bz2 --strip-components=3 -C /usr/local
- name: Force Alire to use preinstalled MSYS2
if: ${{ runner.os == 'Windows' }}
shell: bash
Expand Down
7 changes: 6 additions & 1 deletion utils/gh-build-binaries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@ pip install langkit/
eval `langkit/manage.py setenv | grep -v ^PATH=`
alr --non-interactive get xmlada

TARGET=${CROSS:+$CROSS-linux} # '' or aarch64-linux
if [ $RUNNER_OS = Linux ] ; then
TARGET=${CROSS:+$CROSS-linux} # '' or aarch64-linux
else
TARGET=${CROSS:+$CROSS-darwin} # '' or aarch64-darwin
fi

TARGET_OPTION=${TARGET:+--target=$TARGET} # '' or --target=aarch64-linux

build_archive()
Expand Down

0 comments on commit 65919f6

Please sign in to comment.