From cad13f48797b94a28c66f2a5dadb23dda49bf8aa Mon Sep 17 00:00:00 2001 From: boybook Date: Wed, 17 Apr 2024 09:07:50 +0800 Subject: [PATCH] [CI] Add support for MacOS arm (#5) Add arm-macos github runner https://github.com/boybook https://github.com/williamyang98/SDRPlusPlus-DAB-Radio-Plugin/pull/5 --- .github/workflows/arm-macos.yml | 69 +++++++++++++++++++++++++++++++++ README.md | 1 + 2 files changed, 70 insertions(+) create mode 100644 .github/workflows/arm-macos.yml diff --git a/.github/workflows/arm-macos.yml b/.github/workflows/arm-macos.yml new file mode 100644 index 0000000..021526f --- /dev/null +++ b/.github/workflows/arm-macos.yml @@ -0,0 +1,69 @@ +name: arm-macos + +on: + workflow_dispatch: + push: + branches: [ "master", "dev" ] + +env: + BUILD_TYPE: Release + BUILD_DIR: build + PACKAGE_DIR: build-out + OSX_TARGET: "12.0" + +jobs: + skip_check: + continue-on-error: false + runs-on: ubuntu-22.04 + outputs: + should_skip: ${{ steps.skip_check.outputs.should_skip }} + steps: + - id: skip_check + uses: fkirc/skip-duplicate-actions@v5 + with: + concurrent_skipping: 'same_content' + cancel_others: 'true' + skip_after_successful_duplicate: 'true' + paths_ignore: '["**/README.md", "**/docs/**", "**/LICENSE.txt", "vcpkg.json", "toolchains/windows/*", "toolchains/ubuntu/*"]' + do_not_skip: '["workflow_dispatch", "schedule"]' + + build: + needs: skip_check + if: needs.skip_check.outputs.should_skip != 'true' + + runs-on: macos-14 + + steps: + - uses: actions/checkout@v3 + with: + submodules: recursive + + - name: Update brew + run: brew update + + - name: Install dependencies + run: brew bundle install --file=./toolchains/macos/Brewfile + + - name: Install python mako + run: pip3 install mako --break-system-packages + + - name: Install volk + run: git clone --recursive https://github.com/gnuradio/volk && cd volk && mkdir build && cd build && cmake -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DCMAKE_BUILD_TYPE=Release .. && make -j3 && sudo make install && cd ../../ + + - name: Configure CMake + run: cmake . -B ${{github.workspace}}/${{env.BUILD_DIR}} --preset clang -DCMAKE_OSX_DEPLOYMENT_TARGET=${{env.OSX_TARGET}} -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} + + - name: Build + run: cmake --build ${{github.workspace}}/${{env.BUILD_DIR}} --config ${{env.BUILD_TYPE}} --target dab_plugin + + - name: Create package + run: | + mkdir -p ${{env.PACKAGE_DIR}} + cp ${{env.BUILD_DIR}}/src/*.dylib ${{env.PACKAGE_DIR}}/ + cp README.md ${{env.PACKAGE_DIR}}/ + + - name: Upload files (Release) + uses: actions/upload-artifact@v3 + with: + name: sdrpp_dab_radio_plugin_macos_arm + path: ${{github.workspace}}/${{env.PACKAGE_DIR}} diff --git a/README.md b/README.md index 7063b5d..38a83f2 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ [![x86-windows](https://github.com/williamyang98/SDRPlusPlus-DAB-Radio-Plugin/actions/workflows/x86-windows.yml/badge.svg)](https://github.com/williamyang98/SDRPlusPlus-DAB-Radio-Plugin/actions/workflows/x86-windows.yml) [![x86-ubuntu](https://github.com/williamyang98/SDRPlusPlus-DAB-Radio-Plugin/actions/workflows/x86-ubuntu.yml/badge.svg)](https://github.com/williamyang98/SDRPlusPlus-DAB-Radio-Plugin/actions/workflows/x86-ubuntu.yml) [![x86-macos](https://github.com/williamyang98/SDRPlusPlus-DAB-Radio-Plugin/actions/workflows/x86-macos.yml/badge.svg)](https://github.com/williamyang98/SDRPlusPlus-DAB-Radio-Plugin/actions/workflows/x86-macos.yml) +[![arm-macos](https://github.com/williamyang98/SDRPlusPlus-DAB-Radio-Plugin/actions/workflows/arm-macos.yml/badge.svg)](https://github.com/williamyang98/SDRPlusPlus-DAB-Radio-Plugin/actions/workflows/arm-macos.yml) SDR++ DAB radio plugin.