Skip to content

Commit

Permalink
Add OSX arm64 workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
romainthomas committed May 28, 2023
1 parent b828a2b commit e148d9e
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 7 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/osx-arm64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: 'macOS-arm64'
on:
push:
tags:
- '**'
workflow_dispatch:

jobs:
osx-sdk:
runs-on: macos-11.0
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install system dependencies
run: |
brew install cmake ninja ccache
python -m pip install --upgrade pip setuptools wheel
- name: Get Date
id: get-date
run: |
echo "::set-output name=date::$(/bin/date -u "+%Y-%m-%d-%H;%M;%S")"
shell: bash
- name: Setup cache dir
shell: bash
run: |
mkdir -p ~/.ccache
- name: ccache cache files
uses: actions/cache@v3
with:
path: ~/.ccache
key: osx-${{ runner.os }}-${{ steps.get-date.outputs.date }}
restore-keys: |
osx-${{ runner.os }}-
- name: Upgrade pip
shell: bash
run: |
python -m pip install --upgrade pip setuptools
- name: Build SDK
shell: bash
env:
MACOSX_DEPLOYMENT_TARGET: "11.0"
CCACHE_DIR: ~/.ccache
CCACHE_MAXSIZE: 10.0G
CCACHE_CPP2: 1
CCACHE_COMPRESS: 1
run: |
bash scripts/osx/package_sdk_aarch64.sh
- name: 'Upload SDK Artifact'
uses: actions/upload-artifact@v3
with:
name: osx-sdk
path: build/*.tar.gz
retention-days: 3
- name: Deploy
env:
LIEF_S3_KEY: ${{ secrets.LIEF_S3_KEY }}
LIEF_S3_SECRET: ${{ secrets.LIEF_S3_SECRET }}
shell: bash
run: |
python -m pip install --upgrade requests mako boto3
python .github/deploy.py
18 changes: 11 additions & 7 deletions scripts/osx/package_sdk_aarch64.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
#!/usr/bin/sh
set -ex

mkdir -p build/osx-aarch64/static-release && mkdir -p build/osx-aarch64/shared-release
mkdir -p build/osx-aarch64/static-release && \
mkdir -p build/osx-aarch64/shared-release

pushd build/osx-aarch64/shared-release

cmake ../../.. -GNinja \
-DBUILD_SHARED_LIBS=on \
-DLIEF_PYTHON_API=off \
cmake ../../.. -GNinja \
-DCMAKE_OSX_ARCHITECTURES=arm64 \
-DBUILD_SHARED_LIBS=on \
-DLIEF_PYTHON_API=off \
-DLIEF_INSTALL_COMPILED_EXAMPLES=off \
-DCMAKE_BUILD_TYPE=Release

Expand All @@ -16,9 +19,10 @@ ninja
popd
pushd build/osx-aarch64/static-release

cmake ../../.. -GNinja \
-DBUILD_SHARED_LIBS=off \
-DLIEF_PYTHON_API=off \
cmake ../../.. -GNinja \
-DCMAKE_OSX_ARCHITECTURES=arm64 \
-DBUILD_SHARED_LIBS=off \
-DLIEF_PYTHON_API=off \
-DLIEF_INSTALL_COMPILED_EXAMPLES=on \
-DCMAKE_BUILD_TYPE=Release

Expand Down

0 comments on commit e148d9e

Please sign in to comment.