Skip to content

Merge pull request #9 from kadu-v/feature/version #9

Merge pull request #9 from kadu-v/feature/version

Merge pull request #9 from kadu-v/feature/version #9

name: Build Static Libraries
on:
push:
branches:
- main
jobs:
Build-aarch64-apple-debug:
runs-on: macos-latest
environment: prod-deploy
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Set up Python 3.12.5
uses: actions/setup-python@v5
with:
python-version: 3.12.5
- name: Setup for Macos
shell: bash
run: ./setup_aarch64_macos.sh
- name: Build Executroch library with Debug mode
shell: bash
run: ./build.sh --target=aarch64-apple-ios --mode=Debug --no-venv
- name: Copy the prebuilt library to the executorch-apple directory
run: |
mkdir -p out-apple/executorch-apple-debug
cp -r target/executorch-prebuilt/* out-apple/executorch-apple-debug
- name: Upload Built Library
uses: actions/upload-artifact@v4
with:
name: executorch-apple-debug
path: out-apple
Build-aarch64-apple-release:
runs-on: macos-latest
environment: prod-deploy
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Setup for Macos
shell: bash
run: ./setup_aarch64_macos.sh
- name: Build Executroch library with Release mode
shell: bash
run: ./build.sh --target=aarch64-apple-ios --mode=Release --no-venv
- name: Copy the prebuilt library to the executorch-apple directory
run: |
mkdir -p out-apple/executorch-apple-release
cp -r target/executorch-prebuilt/* out-apple/executorch-apple-release
- name: Upload Built Library
uses: actions/upload-artifact@v4
with:
name: executorch-apple-release
path: out-apple
Build-aarch64-android:
runs-on: ubuntu-latest
environment: prod-deploy
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Set up NDK
uses: nttld/setup-ndk@v1
id: setup-ndk
with:
ndk-version: r27c
add-to-path: false
- name: Setup for Linux
shell: bash
run: ./setup_amd64_linux.sh
- name: Build Executroch library with Debug mode
shell: bash
run: |
./build.sh --target=aarch64-linux-android --mode=Debug --no-venv
env:
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
- name: Build Executroch library with Release mode
shell: bash
run: ./build.sh --target=aarch64-linux-android --mode=Release --no-venv
env:
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
- name: Copy the prebuilt library to the executorch-android directory
run: |
mkdir -p out-android/executorch-android
cp -r target/executorch-prebuilt/* out-android/executorch-android
- name: Upload Built Library
uses: actions/upload-artifact@v4
with:
name: executorch-android
path: out-android
Upload-Release:
runs-on: ubuntu-latest
environment: prod-deploy
needs: [Build-aarch64-apple-debug, Build-aarch64-apple-release, Build-aarch64-android]
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Download executorch-apple-debug
uses: actions/download-artifact@v4
with:
name: executorch-apple-debug
- name: Download executorch-apple-release
uses: actions/download-artifact@v4
with:
name: executorch-apple-release
- name: Download executorch-android
uses: actions/download-artifact@v4
with:
name: executorch-android
- name: Set the tag from TAG file to environment variable
run: |
export TAG=$(cat TAG)
echo "TAG: $TAG"
echo "TAG=${TAG}" >> $GITHUB_ENV
- name: Create a zip of both artifacts
run: |
mkdir executorch-prebuilt-${TAG}
touch executorch-prebuilt-${TAG}/.gitkeep
cp -r executorch-apple-debug/* executorch-prebuilt-${TAG}/
cp -r executorch-apple-release/* executorch-prebuilt-${TAG}/
cp -r executorch-android/* executorch-prebuilt-${TAG}/
zip -r release-${TAG}.zip executorch-prebuilt-${TAG}
- name: Upload release assets
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: release-${{ env.TAG }}.zip
tag_name: ${{ env.TAG }}