From fffc188475d0c2bcba9eb91b7da631d4bc215603 Mon Sep 17 00:00:00 2001 From: Brendan Hansen Date: Mon, 4 Dec 2023 11:11:22 -0600 Subject: [PATCH] added: MacOS builds for OVM in GitHub Actions --- .github/workflows/onyx-build.yml | 39 +++++++++++++++++++++++++++++++- interpreter/build.sh | 4 ++++ 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/.github/workflows/onyx-build.yml b/.github/workflows/onyx-build.yml index db661fe7..91d8e0a4 100644 --- a/.github/workflows/onyx-build.yml +++ b/.github/workflows/onyx-build.yml @@ -33,7 +33,7 @@ jobs: echo $DOING_RELEASE build: - name: Building on ${{ matrix.build }} + name: Building on ${{ matrix.build }}-${{ matrix.runtime_library }} runs-on: ${{ matrix.os }} needs: [ setup ] strategy: @@ -70,6 +70,15 @@ jobs: os: macos-12 runtime_library: wasmer artifact_name: 'onyx-darwin-wasmer-amd64' + - build: darwin-amd64 + os: macos-12 + runtime_library: ovmwasm + artifact_name: 'onyx-darwin-ovm-amd64' + - build: darwin-arm64 + os: macos-12 + runtime_library: ovmwasm + target: aarch64-apple-darwin + artifact_name: 'onyx-darwin-ovm-arm64' - build: windows-amd64 os: windows-latest artifact_name: 'onyx-windows-wasmer-amd64' @@ -146,6 +155,16 @@ jobs: WASMER_LIB_PATH: ../wasmer/lib ONYX_RUNTIME_LIBRARY: wasmer-custom + - name: Build Onyx for ${{ matrix.build }}-${{ matrix.runtime_library }} + if: (matrix.build == 'darwin-arm64') && (matrix.runtime_library == 'ovmwasm') + run: | + ./build.sh compile compress + env: + ONYX_CC: gcc + ONYX_ARCH: darwin_arm64 + ONYX_TARGET: aarch64-apple-darwin + ONYX_RUNTIME_LIBRARY: ovmwasm + - name: Build Onyx for ${{ matrix.build }}-${{ matrix.runtime_library }} if: (matrix.build == 'darwin-arm64') && (matrix.runtime_library == 'none') run: | @@ -259,6 +278,24 @@ jobs: asset_path: artifacts/onyx-darwin-wasmer-arm64/onyx.tar.gz asset_name: onyx-darwin-wasmer-arm64.tar.gz asset_content_type: application/gzip + - name: Upload Release Asset MacOS AMD64 (OVMwasm) + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: artifacts/onyx-darwin-ovm-amd64/onyx.tar.gz + asset_name: onyx-darwin-ovm-amd64.tar.gz + asset_content_type: application/gzip + - name: Upload Release Asset MacOS ARM64 (OVMwasm) + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: artifacts/onyx-darwin-ovm-arm64/onyx.tar.gz + asset_name: onyx-darwin-ovm-arm64.tar.gz + asset_content_type: application/gzip - name: Upload Release Asset Window X64 uses: actions/upload-release-asset@v1 env: diff --git a/interpreter/build.sh b/interpreter/build.sh index 86f12b96..8816ef68 100755 --- a/interpreter/build.sh +++ b/interpreter/build.sh @@ -8,6 +8,10 @@ TARGET="../shared/lib/$ONYX_ARCH/lib/libovmwasm.a" C_FILES="src/ovmwasm.c src/vm/*.c src/wasm/*.c src/debug/*.c" INCLUDES="-I../shared/include -Iinclude" +if [ ! -z ${ONYX_TARGET+x} ]; then + FLAGS="$FLAGS --target=$ONYX_TARGET" +fi + mkdir -p "build_tmp" echo "Compiling ovmwasm to $TARGET" -- 2.25.1