From 8885d39c7b379e2b45fecc2dac1b1283ce7c8fe4 Mon Sep 17 00:00:00 2001 From: TheTechnobear Date: Mon, 12 Feb 2024 13:46:42 +0100 Subject: [PATCH] add gh action --- .clang-format | 34 ++++ .github/workflows/build.yml | 152 ++++++++++++++++++ .gitignore | 6 +- eigenapi/CMakeLists.txt | 23 ++- .../unsupported/pico_decoder_1_0_0.dll | Bin 0 -> 16896 bytes 5 files changed, 209 insertions(+), 6 deletions(-) create mode 100644 .clang-format create mode 100644 .github/workflows/build.yml create mode 100755 resources/picodecoder/unsupported/pico_decoder_1_0_0.dll diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..1d0a2df --- /dev/null +++ b/.clang-format @@ -0,0 +1,34 @@ +--- +BasedOnStyle: Google +IndentWidth: 4 +ColumnLimit: 120 +UseTab: Never + +--- +Language: Cpp + +AccessModifierOffset: -4 +AllowShortBlocksOnASingleLine: true +AllowShortCaseLabelsOnASingleLine: true +AllowShortFunctionsOnASingleLine: InlineOnly + +BreakBeforeBraces: Custom +BraceWrapping: + AfterClass: false + AfterControlStatement: false + AfterEnum: false + AfterFunction: false + AfterNamespace: false + AfterObjCDeclaration: false + AfterStruct: false + AfterUnion: false + BeforeCatch: false + BeforeElse: false + IndentBraces: false + +Cpp11BracedListStyle: false + +MaxEmptyLinesToKeep: 2 + +--- + diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..ba475fb --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,152 @@ +name: Build EigenLite +permissions: + contents: write + +on: + push: + tags: + - '*' + +jobs: + # Ubuntu - would need libusb + + # build: + # runs-on: ${{ matrix.os }} + + # strategy: + # # Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable. + # fail-fast: false + + # # Set up a matrix to run the following 3 configurations: + # # 1. + # # 2. + # # 3. + # # + # # To add more build types (Release, Debug, RelWithDebInfo, etc.) customize the build_type list. + # matrix: + # # os: [ubuntu-latest] + # # os: [ubuntu-latest, windows-latest] + # build_type: [Release] + # c_compiler: [clang] + # cpp_compiler: [clang++] + + # steps: + # - name: Checkout repository + # uses: actions/checkout@v3 + # with: + # submodules: 'true' + + # - name: Set reusable strings + # # Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file. + # id: strings + # shell: bash + # run: | + # echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" + + # - name: Configure CMake + # # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. + # # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type + # run: > + # cmake -B ${{ steps.strings.outputs.build-output-dir }} + # -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} + # -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} + # -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} + # -S ${{ github.workspace }} + + # - name: Build + # # Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). + # run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} + + # - name: Upload artifacts + # uses: actions/upload-artifact@v3 + # with: + # path: dist/* + # name: ${{runner.os}} + + build-mac: + name: mac + runs-on: macos-latest + strategy: + fail-fast: false + matrix: + build_type: [Release] + c_compiler: [clang] + cpp_compiler: [clang++] + platform: [x86_64, arm64] + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + submodules: 'true' + + - name: Set reusable strings + # Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file. + id: strings + shell: bash + run: | + echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" + + - name: Configure CMake + # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. + # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type + run: > + cmake -B ${{ steps.strings.outputs.build-output-dir }} + -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} + -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} + -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} + -DCMAKE_OSX_ARCHITECTURES=${{ matrix.platform }} + -S ${{ github.workspace }} + + - name: Build + # Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). + run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} + + - name: Upload artifacts + uses: actions/upload-artifact@v3 + with: + path: dist/* + name: mac-${{ matrix.platform }} + + publish-header: + name: publish-header + runs-on: ubuntu-latest + strategy: + fail-fast: false + steps: + - uses: actions/checkout@v3 + - name: Upload artifact + uses: actions/upload-artifact@v3 + with: + path: ${{ github.workspace }}/eigenapi/eigenapi.h + name: header + + + publish: + name: Publish release + # only create a release if a tag was created that is called e.g. v1.2.3 + if: startsWith(github.ref, 'refs/tags/v') + runs-on: ubuntu-latest + # needs: [build, build-mac,publish-header] + needs: [build-mac,publish-header] + steps: + - uses: actions/checkout@v3 + - uses: FranzDiebold/github-env-vars-action@v2 + - name: Create Release + uses: softprops/action-gh-release@v1 + with: + tag_name: ${{ github.ref }} + name: Release ${{ env.CI_REF_NAME }} + body: | + ${{ env.CI_REPOSITORY_NAME }} EigenLite ${{ env.CI_REF_NAME }} + draft: false + prerelease: false + - uses: actions/download-artifact@v3 + with: + path: _artifacts + - name: Upload release assets + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: _artifacts/**/* + tag: ${{ github.ref }} + file_glob: true diff --git a/.gitignore b/.gitignore index b1bd5de..9f0cf9b 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,6 @@ *.lock profile **/build/* -build* **/*.sublime-workspace cmake-build*/ @@ -30,11 +29,8 @@ Podfile.lock !default.perspectivev3 *.xccheckout -**/*.pd_linux -**/*.pd_darwin -**/*.dll -**/*.o build/**/*.so build/**/*.dylib +dist/* diff --git a/eigenapi/CMakeLists.txt b/eigenapi/CMakeLists.txt index 3c5c8c0..beeda99 100644 --- a/eigenapi/CMakeLists.txt +++ b/eigenapi/CMakeLists.txt @@ -3,6 +3,24 @@ project (eigenapi) # USE_DUMMY_PICO - if you do not want to use prebuilt binaries (advanced use only), implies dynamic! # USE_DYNAMIC - use shared libraries for pico decoder + +# REL_DIR not supported currently +set(REL_DIR "${CMAKE_SOURCE_DIR}/release/eigenapi") + +if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") + set(REL_DIR "${REL_DIR}/macOs/${CMAKE_OSX_ARCHITECTURES}") + set(REL_FILE "eigenapi-macOs-${CMAKE_OSX_ARCHITECTURES}") +elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux") + set(REL_DIR "${REL_DIR}/linux/${CMAKE_HOST_SYSTEM_PROCESSOR}") + set(REL_FILE "eigenapi-linux-${CMAKE_HOST_SYSTEM_PROCESSOR}") +elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows") + set(REL_DIR "${REL_DIR}/windows/${CMAKE_HOST_SYSTEM_PROCESSOR}") + set(REL_FILE "eigenapi-win-${CMAKE_HOST_SYSTEM_PROCESSOR}") +else() + set(REL_DIR "${REL_DIR}/unknown/${CMAKE_HOST_SYSTEM_PROCESSOR}") + set(REL_FILE "eigenapi-unknown-${CMAKE_HOST_SYSTEM_PROCESSOR}") +endif() + if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") #temporary, so I can see 'real' errors set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations") @@ -87,7 +105,10 @@ target_include_directories(eigenapi PUBLIC . ) - +add_custom_command(TARGET eigenapi POST_BUILD +COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_SOURCE_DIR}/dist +COMMAND ${CMAKE_COMMAND} -E copy $ ${CMAKE_SOURCE_DIR}/dist/${REL_FILE}.a +) if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) target_link_libraries(eigenapi atomic) diff --git a/resources/picodecoder/unsupported/pico_decoder_1_0_0.dll b/resources/picodecoder/unsupported/pico_decoder_1_0_0.dll new file mode 100755 index 0000000000000000000000000000000000000000..042c9203e2e2c18a01a7e8237e03d7e0f4b88985 GIT binary patch literal 16896 zcmeHu4OCm#mF@+Ek!=wv8A#NIHVPwVXzdV;085rgkUPJkPK6?h9CrdOUAe6O-BlRu zTkiV)E!^?tKe_uv)TW=@UF!C97}~vUJH53nhWgsp);6D^&SmiWTMeF8L;jW$LrYtO zD=j{Lg;7@h>8|P9-_Skdh?Hk9{@U?6?q66R>-Zs~|E1#yyN_{vpS8Ei{6xnwcCT{0 z$=W#9ZuQi=N!QJmJ3-kL70b>1^D9LW-WV5s_sXc{9G3=)PNKe@Eq~5s_c}(8=D1ji zJ==2oK!DS()N>rzxS)XPh_uq}s~GnfxO>-goQ=e4IPO)c1KrJC?Hu=X6vw@g%W+9_ zRK=%s`%QBL`TYv1IYOGx)#<~n{vK3hA7O>v^DhIeO7k|<`f53@b{ROiC~A}plzCS! zIBAj?=cYyDL?JBeQ085^92ZLSc6i|$32O~L(3s2tXyq%H^m$#)Z4mr6uygPM(+9@< z3%Bd%-~ZwBf1U@ly@Ntu3N}91H>U2ps$SXGKQ#Xu$v3Kk*VMyD4nSn&gW-{P#%`RB z@-H799wEGvJ(>R#9ByJ+&o`;n_IhUcW}`kB(gpj}!S|yulzyb*8t6BOF5OPzc6#pi z6Wo3}cRTGr39Aj(sgBB?s{gIl_9pD&OO1wtV80684I|rUtW(~r)jJ;AUfJI*?#?vb z=y^ch^DQHdZ@M6ynfkxLXduyf2)_V(17~PU2d_u@ho#;_Ln9vyP&aP0LN}1B7IDpU z9^43iu8Q^=2{6fpV&D>Wwv#LkA>E%6IoPS<{HoDhUB6JM?jGz?Z{(?c?AJjv=f7nX zt7U*=>YciNNTFW?)Ln`n#(Wa@Qv5lZ*}hTmX;x?Lb*kl|Vc6{GLqkDJL~Rs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