diff --git a/.github/workflows/build_wrapper.yaml b/.github/workflows/build_wrapper.yaml index 9b09d0ec..5e57980f 100644 --- a/.github/workflows/build_wrapper.yaml +++ b/.github/workflows/build_wrapper.yaml @@ -1,7 +1,14 @@ name: Multiplatform build of libuuu wrapper python package on: push: - branches: [master] + branches: + - master + tags: + - uuu* + pull_request: + types: + - opened + - synchronize jobs: build-dlls: @@ -10,6 +17,12 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest, macos-latest] + arch: [x86_64, arm64] + exclude: + - os: windows-latest + arch: arm64 + - os: ubuntu-latest + arch: arm64 steps: - name: Checkout uuu repository @@ -56,7 +69,11 @@ jobs: if: matrix.os != 'windows-latest' run: | export PATH=$VCPKG_ROOT:$PATH - cmake --preset=unix + if [ "${{ matrix.os }}" == "ubuntu-latest" ]; then + cmake --preset=unix; + else + cmake --preset=unix -DCMAKE_OSX_ARCHITECTURES=${{ matrix.arch }}; + fi cmake --build build - name: Build on Windows @@ -78,19 +95,47 @@ jobs: if: matrix.os == 'macos-latest' uses: actions/upload-artifact@v4 with: - name: libuuu-macos + name: pre-libuuu-macos-${{ matrix.arch }} path: ./wrapper/build/libuuu.dylib - name: Upload artifacts Ubuntu if: matrix.os == 'ubuntu-latest' uses: actions/upload-artifact@v4 with: - name: libuuu-ubuntu + name: libuuu-ubuntu-${{ matrix.arch }} path: ./wrapper/build/libuuu.so + create-universal-dylib: + runs-on: macos-latest + needs: build-dlls + steps: + - name: Download x86_64 artifacts + uses: actions/download-artifact@v4 + with: + name: pre-libuuu-macos-x86_64 + path: ./x86_64 + - name: Download arm64 artifacts + uses: actions/download-artifact@v4 + with: + name: pre-libuuu-macos-arm64 + path: ./arm64 + + - name: Create build directory + run: mkdir -p ./wrapper/build + + - name: Create universal dylib + run: | + lipo -create -output ./wrapper/build/libuuu.dylib ./x86_64/libuuu.dylib ./arm64/libuuu.dylib + + - name: Upload universal dylib + uses: actions/upload-artifact@v4 + with: + name: libuuu-macos-universal + path: ./wrapper/build/libuuu.dylib + build-libuuu-wrapper: runs-on: ubuntu-latest - needs: build-dlls + needs: create-universal-dylib steps: - name: Checkout uuu repository uses: actions/checkout@v3 diff --git a/README.md b/README.md index c3568598..9c33a74c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@ # uuu (Universal Update Utility), mfgtools 3.0 - [![macOS Build](https://github.com/nxp-imx/mfgtools/actions/workflows/macOS.yaml/badge.svg?branch=master)](https://github.com/nxp-imx/mfgtools/actions/workflows/macOS.yaml) [![Build with VS Studio](https://github.com/nxp-imx/mfgtools/actions/workflows/win.yaml/badge.svg)](https://github.com/nxp-imx/mfgtools/actions/workflows/win.yaml) [![Build for x64 ubuntu-lastest](https://github.com/nxp-imx/mfgtools/actions/workflows/build.yaml/badge.svg)](https://github.com/nxp-imx/mfgtools/actions/workflows/build.yaml)