From 0cbca7ef0d3edd036c32886ac3f1bb18286679ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Micha=C3=ABl=20Celerier?= Date: Sat, 19 Jul 2025 18:07:22 -0400 Subject: [PATCH 1/3] workflows: try to simplify by using external actions --- .github/workflows/builds-dev.yaml | 107 ++++++---------- .github/workflows/builds-sdk.yaml | 155 ++++++----------------- .github/workflows/jit.yml | 197 ++++-------------------------- 3 files changed, 98 insertions(+), 361 deletions(-) diff --git a/.github/workflows/builds-dev.yaml b/.github/workflows/builds-dev.yaml index 133ac2a..f6e17c8 100644 --- a/.github/workflows/builds-dev.yaml +++ b/.github/workflows/builds-dev.yaml @@ -24,36 +24,25 @@ jobs: matrix: config: - { - # FIXME: build a shared library name: "Windows", os: windows-latest, - path: "/c/ossia-sdk/llvm/bin", - common_flags: "-GNinja -DCMAKE_C_COMPILER=c:/ossia-sdk/llvm/bin/clang.exe -DCMAKE_CXX_COMPILER=c:/ossia-sdk/llvm/bin/clang++.exe -DCMAKE_UNITY_BUILD=1", - debug_flags: "-DCMAKE_BUILD_TYPE=Debug", - release_flags: "-DCMAKE_BUILD_TYPE=Release", dependencies: "choco install -y ninja", - sdk: "/c/ossia-sdk", + additional_flags: "-GNinja" } - { name: "Ubuntu", os: ubuntu-latest, - path: "/opt/ossia-sdk/llvm/bin", - common_flags: "-DCMAKE_C_COMPILER=/opt/ossia-sdk/llvm/bin/clang -DCMAKE_CXX_COMPILER=/opt/ossia-sdk/llvm/bin/clang++ -DCMAKE_UNITY_BUILD=1", - debug_flags: "-DCMAKE_BUILD_TYPE=Debug", - release_flags: "-DCMAKE_BUILD_TYPE=Release", dependencies: "sudo apt install -yqq libgl-dev libgl1-mesa-dev libegl1-mesa-dev libdrm-dev libxcomposite-dev libxkbcommon-dev libxkbcommon-x11-dev libwayland-dev libxcb-*-dev libX11-*-dev libz-dev libtinfo6 libxext-dev", - sdk: "/opt/ossia-sdk", + additional_flags: "" } - { name: "macOS", os: macos-latest, - common_flags: "-DCMAKE_UNITY_BUILD=1", - debug_flags: "-DCMAKE_BUILD_TYPE=Debug", - release_flags: "-DCMAKE_BUILD_TYPE=Release", - sdk: "/opt/ossia-sdk-aarch64", + dependencies: "", + additional_flags: "" } steps: - - name: Checkout code + - name: Checkout addon uses: actions/checkout@v4 with: submodules: "recursive" @@ -67,76 +56,56 @@ jobs: path: score - name: Install dependencies + if: matrix.config.dependencies != '' shell: bash run: | ${{ matrix.config.dependencies }} - - name: Download SDK - shell: bash - run: | - cd score - tools/fetch-sdk.sh + - name: Download OSSIA SDK + uses: ossia/actions/download-ossia-sdk@master + with: + score-path: score - name: Build debug - shell: bash - run: | - mkdir build-debug - cd build-debug - - if [[ "${{ matrix.config.path }}" != "" ]]; then - export PATH=${{ matrix.config.path }}:$PATH - fi - - cmake ../addon \ - -DCMAKE_MODULE_PATH=../score/cmake \ - -DSCORE_SOURCE_DIR=../score \ - -DOSSIA_SDK=${{ matrix.config.sdk }} \ - ${{ matrix.config.common_flags }} \ - ${{ matrix.config.debug_flags }} - - cmake --build . + uses: ossia/actions/build-addon@master + with: + addon-path: addon + build-type: Debug + score-path: score + ossia-sdk-path: ${{ steps.download-ossia-sdk.outputs.sdk-path }} + additional-flags: ${{ matrix.config.additional_flags }} - name: Build release - shell: bash - run: | - mkdir build-release - cd build-release - - if [[ "${{ matrix.config.path }}" != "" ]]; then - export PATH=${{ matrix.config.path }}:$PATH - fi - - cmake ../addon \ - -DCMAKE_MODULE_PATH=../score/cmake \ - -DSCORE_SOURCE_DIR=../score \ - -DOSSIA_SDK=${{ matrix.config.sdk }} \ - -DCMAKE_INSTALL_PREFIX=install \ - ${{ matrix.config.common_flags }} \ - ${{ matrix.config.release_flags }} - - cmake --build . - cmake --build . --target install + uses: ossia/actions/build-addon@master + with: + addon-path: addon + build-type: Release + score-path: score + ossia-sdk-path: ${{ steps.download-ossia-sdk.outputs.sdk-path }} + additional-flags: ${{ matrix.config.additional_flags }} - name: Upload release uses: actions/upload-artifact@v4 with: name: plugin-${{ matrix.config.os }} path: | - build-release/install/plugins + build-Release/install/plugins - upload: - name: Combine + package: + name: Package needs: build - runs-on: ubuntu-latest steps: - - name: Download all workflow run artifacts - uses: actions/download-artifact@v4 + - name: Checkout addon + uses: actions/checkout@v4 + with: + submodules: "recursive" - - name: ls - shell: bash - run: | - pwd - ls - find . + - name: Package addon + uses: ossia/actions/package-addon@master + - name: Upload package + uses: actions/upload-artifact@v4 + with: + name: plugin + path: deploy \ No newline at end of file diff --git a/.github/workflows/builds-sdk.yaml b/.github/workflows/builds-sdk.yaml index d41d010..d9fb665 100644 --- a/.github/workflows/builds-sdk.yaml +++ b/.github/workflows/builds-sdk.yaml @@ -26,166 +26,85 @@ jobs: - { name: "Windows", os: windows-latest, - path: "/c/ossia-sdk/llvm/bin", - common_flags: "-GNinja -DCMAKE_C_COMPILER=c:/ossia-sdk/llvm/bin/clang.exe -DCMAKE_CXX_COMPILER=c:/ossia-sdk/llvm/bin/clang++.exe -DCMAKE_UNITY_BUILD=1", - debug_flags: "-DCMAKE_BUILD_TYPE=Debug", - release_flags: "-DCMAKE_BUILD_TYPE=Release", dependencies: "choco install -y ninja", - sdk: "/c/ossia-sdk", - score_sdk: "sdk-windows-x86_64.zip" + additional_flags: "-GNinja" } - { name: "Ubuntu", os: ubuntu-latest, - path: "/opt/ossia-sdk/llvm/bin", - common_flags: "-DCMAKE_C_COMPILER=/opt/ossia-sdk/llvm/bin/clang -DCMAKE_CXX_COMPILER=/opt/ossia-sdk/llvm/bin/clang++ -DCMAKE_UNITY_BUILD=1", - debug_flags: "-DCMAKE_BUILD_TYPE=Debug", - release_flags: "-DCMAKE_BUILD_TYPE=Release", dependencies: "sudo apt install -yqq libgl-dev libgl1-mesa-dev libegl1-mesa-dev libdrm-dev libxcomposite-dev libxkbcommon-dev libxkbcommon-x11-dev libwayland-dev libxcb-*-dev libX11-*-dev libz-dev libtinfo6 libxext-dev", - sdk: "/opt/ossia-sdk", - score_sdk: "sdk-linux-x86_64.zip" + additional_flags: "" } - { name: "macOS", os: macos-latest, - common_flags: "-DCMAKE_UNITY_BUILD=1", - debug_flags: "-DCMAKE_BUILD_TYPE=Debug", - release_flags: "-DCMAKE_BUILD_TYPE=Release", - sdk: "/opt/ossia-sdk-aarch64", - score_sdk: "sdk-darwin-aarch64.zip" + dependencies: "", + additional_flags: "" } steps: - - name: Checkout code + - name: Checkout addon uses: actions/checkout@v4 with: submodules: "recursive" path: addon - - uses: suisei-cn/actions-download-file@v1.3.0 - name: Download fetch-sdk script - with: - url: "https://github.com/ossia/score/raw/master/tools/fetch-sdk.sh" - target: . - - name: Install dependencies + if: matrix.config.dependencies != '' shell: bash run: | ${{ matrix.config.dependencies }} - - name: Download ossia SDK - shell: bash - run: | - chmod +x fetch-sdk.sh - ./fetch-sdk.sh - - - name: Download score headers - uses: robinraju/release-downloader@v1.7 - with: - repository: "ossia/score" - tag: "continuous" - fileName: ${{ matrix.config.score_sdk }} + - name: Download OSSIA SDK + uses: ossia/actions/download-ossia-sdk@master + id: ossia-sdk - - name: Extract score headers - shell: bash - run: | - cmake -E tar xzf ${{ matrix.config.score_sdk }} + - name: Download Score SDK + uses: ossia/actions/download-score-sdk@master + id: score-sdk + with: + version: continuous - name: Build debug - shell: bash - run: | - mkdir build-debug - cd build-debug - - if [[ "${{ matrix.config.path }}" != "" ]]; then - export PATH=${{ matrix.config.path }}:$PATH - fi - - cmake ../addon \ - -DCMAKE_MODULE_PATH=../usr/lib/cmake/score \ - -DSCORE_SDK=$PWD/../usr \ - -DOSSIA_SDK=${{ matrix.config.sdk }} \ - ${{ matrix.config.common_flags }} \ - ${{ matrix.config.debug_flags }} - - cmake --build . + uses: ossia/actions/build-addon@master + with: + addon-path: addon + build-type: Debug + score-sdk-path: ${{ steps.score-sdk.outputs.sdk-path }} + ossia-sdk-path: ${{ steps.ossia-sdk.outputs.sdk-path }} + additional-flags: ${{ matrix.config.additional_flags }} - name: Build release - shell: bash - run: | - mkdir build-release - cd build-release - - if [[ "${{ matrix.config.path }}" != "" ]]; then - export PATH=${{ matrix.config.path }}:$PATH - fi - - cmake ../addon \ - -DCMAKE_MODULE_PATH=../usr/lib/cmake/score \ - -DSCORE_SDK=$PWD/../usr \ - -DOSSIA_SDK=${{ matrix.config.sdk }} \ - -DCMAKE_INSTALL_PREFIX=install \ - ${{ matrix.config.common_flags }} \ - ${{ matrix.config.release_flags }} - - cmake --build . - cmake --build . --target install + uses: ossia/actions/build-addon@master + with: + addon-path: addon + build-type: Release + score-sdk-path: ${{ steps.score-sdk.outputs.sdk-path }} + ossia-sdk-path: ${{ steps.ossia-sdk.outputs.sdk-path }} + additional-flags: ${{ matrix.config.additional_flags }} - name: Upload release uses: actions/upload-artifact@v4 with: name: plugin-${{ matrix.config.os }} path: | - build-release/install/plugins - build-release/install/lib + build-Release/install/plugins + build-Release/install/lib - upload: - name: Combine + package: + name: Package needs: build - runs-on: ubuntu-latest steps: - - name: Checkout code + - name: Checkout addon uses: actions/checkout@v4 with: submodules: "recursive" - path: addon - - name: Download all workflow run artifacts - uses: actions/download-artifact@v4 + - name: Package addon + uses: ossia/actions/package-addon@master - - name: Create addon release - shell: bash - run: | - pwd - ls - find . - - mkdir deploy - - find . -name '*.so' -exec cp {} deploy/ \; - find . -name '*.dylib' -exec cp {} deploy/ \; - find . -name '*.dll' -exec cp {} deploy/ \; - - ls deploy/ - cd deploy/ - WIN32_PLUGIN=$(basename *.dll) - LINUX_PLUGIN=$(basename *.so) - MACOS_PLUGIN=$(basename *.dylib) - cat ../addon/addon.json - cat ../addon/addon.json \ - | jq \ - --arg win64 "$WIN32_PLUGIN" \ - --arg linux64 "$LINUX_PLUGIN" \ - --arg darwin64 "$MACOS_PLUGIN" \ - '. + { "windows-x86_64": $win64, "linux-x86_64": $linux64, "darwin-aarch64": $darwin64 }' \ - > localaddon.json - - cat localaddon.json - cp -rf ../addon/LICENSE* . - cp -rf ../addon/README* . - - - name: Upload release + - name: Upload package uses: actions/upload-artifact@v4 with: name: plugin - path: deploy + path: deploy \ No newline at end of file diff --git a/.github/workflows/jit.yml b/.github/workflows/jit.yml index 9342742..59ff45c 100644 --- a/.github/workflows/jit.yml +++ b/.github/workflows/jit.yml @@ -16,192 +16,41 @@ concurrency: cancel-in-progress: true jobs: - build: - name: "${{ matrix.config.name }} ${{ matrix.version }}" + jit-stable: + name: "JIT ${{ matrix.config.name }} ${{ matrix.version }}" runs-on: ${{ matrix.config.os }} timeout-minutes: 10 strategy: fail-fast: false matrix: - version: [ 3.5.3 ] + version: [ 3.5.3, "continuous" ] config: - - { - name: "Windows", - os: windows-latest, - score: "win64.exe", - sdk: sdk-windows-x86_64.zip, - } - - { - name: "Ubuntu", - os: ubuntu-latest, - score: "linux-x86_64.AppImage", - sdk: sdk-linux-x86_64.zip, - } - - { - name: "macOS", - os: macos-latest, - score: "macOS-AppleSilicon.dmg", - sdk: sdk-darwin-aarch64.zip, - } + - { name: "Windows", os: windows-latest } + - { name: "Ubuntu", os: ubuntu-latest } + - { name: "macOS", os: macos-latest } steps: - - name: Checkout code + - name: Checkout addon uses: actions/checkout@v4 with: submodules: "recursive" - - name: Download score - shell: bash - run: | - SCORE_FILENAME=ossia.score-${{ matrix.version }}-${{ matrix.config.score }} - curl -L -O "https://github.com/ossia/score/releases/download/v${{ matrix.version }}/$SCORE_FILENAME" - - - name: Install score - if: matrix.config.name == 'macOS' - shell: bash - run: | - SCORE_FILENAME=ossia.score-${{ matrix.version }}-${{ matrix.config.score }} - /usr/bin/hdiutil convert -quiet $SCORE_FILENAME -format UDTO -o score - /usr/bin/hdiutil attach -quiet -nobrowse -noverify -noautoopen -mountpoint /Volumes/score score.cdr - ls /Volumes - ls /Volumes/score - - - name: Install score - if: matrix.config.name == 'Windows' - shell: bash - run: | - SCORE_FILENAME=ossia.score-${{ matrix.version }}-${{ matrix.config.score }} - 7z x $SCORE_FILENAME - - - name: Download SDK - shell: bash - run: | - SDK_FILENAME=${{ matrix.config.sdk }} - curl -L -O "https://github.com/ossia/score/releases/download/v${{ matrix.version }}/$SDK_FILENAME" - mkdir -p "$HOME/Documents/ossia/score/sdk" - unzip -qq "$SDK_FILENAME" -d "$HOME/Documents/ossia/score/sdk/${{ matrix.version }}" - - - name: Compile - if: matrix.config.name == 'macOS' - shell: bash - run: | - find /Volumes/score - SCORE_FILENAME="/Volumes/score/ossia score.app/Contents/MacOS/ossia score" - - find . -name '*.hpp' -exec "$SCORE_FILENAME" --no-gui --compile-addon {} \; - - - name: Compile - if: matrix.config.name == 'Windows' - shell: bash - run: | - SCORE_FILENAME=./score.exe - export SCORE_JIT_SDK="$PWD/sdk/usr" - export QT_FORCE_STDERR_LOGGING=1 - export QT_ASSUME_STDERR_HAS_CONSOLE=1 - - find . -name '*.hpp' -exec "$SCORE_FILENAME" --no-gui --compile-addon {} \; - - - name: Compile - if: matrix.config.name == 'Ubuntu' - shell: bash - run: | - sudo apt -y install xvfb libasound2t64 libxcb1 libegl1 libgl1-mesa-dev libegl1-mesa-dev libglvnd0 libx11-6 libxcb-glx0 libgl1 libdbus-1-3 libxcb-xkb1 libxkbcommon-x11-0 libxcb-xkb1 libfuse2 - SCORE_FILENAME=ossia.score-${{ matrix.version }}-${{ matrix.config.score }} - chmod +x "$SCORE_FILENAME" - - find . -name '*.hpp' -exec xvfb-run --auto-servernum "./$SCORE_FILENAME" --no-gui --compile-addon {} \; - - build_head: - name: "${{ matrix.config.name }} (latest)" - runs-on: ${{ matrix.config.os }} - timeout-minutes: 10 - strategy: - fail-fast: false - matrix: - config: - - { - name: "Windows", - os: windows-latest, - score: "win64.exe", - sdk: sdk-windows-x86_64.zip, - } - - { - name: "Ubuntu", - os: ubuntu-latest, - score: "linux-x86_64.AppImage", - sdk: sdk-linux-x86_64.zip, - } - - { - name: "macOS", - os: macos-latest, - score: "macOS-AppleSilicon.dmg", - sdk: sdk-darwin-aarch64.zip, - } - - steps: - - name: Checkout code - uses: actions/checkout@v4 + - name: Download Score SDK + uses: ossia/actions/download-score-sdk@master + if: ${{ matrix.version != 'continuous' }} with: - submodules: "recursive" - - - name: Download score - shell: bash - run: | - SCORE_FILENAME=ossia.score-master-${{ matrix.config.score }} - curl -L -O "https://github.com/ossia/score/releases/download/continuous/$SCORE_FILENAME" - - - name: Install score - if: matrix.config.name == 'macOS' - shell: bash - run: | - SCORE_FILENAME=ossia.score-master-${{ matrix.config.score }} - /usr/bin/hdiutil convert -quiet $SCORE_FILENAME -format UDTO -o score - /usr/bin/hdiutil attach -quiet -nobrowse -noverify -noautoopen -mountpoint /Volumes/score score.cdr - ls /Volumes - ls /Volumes/score - - - name: Install score - if: matrix.config.name == 'Windows' - shell: bash - run: | - SCORE_FILENAME=ossia.score-master-${{ matrix.config.score }} - 7z x $SCORE_FILENAME + version: "v${{ matrix.version }}" + extract-path: "${{ runner.temp }}/sdk" - - name: Download SDK - shell: bash - run: | - SDK_FILENAME=${{ matrix.config.sdk }} - curl -L -O "https://github.com/ossia/score/releases/download/continuous/$SDK_FILENAME" - mkdir -p "$HOME/Documents/ossia/score/sdk" - unzip -qq "$SDK_FILENAME" -d "sdk" - - - name: Compile - if: matrix.config.name == 'macOS' - shell: bash - run: | - export SCORE_JIT_SDK="$PWD/sdk/usr" - SCORE_FILENAME="/Volumes/score/ossia score.app/Contents/MacOS/ossia score" - - find . -name '*.hpp' -exec "$SCORE_FILENAME" --no-gui --compile-addon {} \; - - - name: Compile - if: matrix.config.name == 'Windows' - shell: bash - run: | - SCORE_FILENAME=./score.exe - export SCORE_JIT_SDK="$PWD/sdk/usr" - export QT_FORCE_STDERR_LOGGING=1 - export QT_ASSUME_STDERR_HAS_CONSOLE=1 - - find . -name '*.hpp' -exec "$SCORE_FILENAME" --no-gui --compile-addon {} \; - - - name: Compile - if: matrix.config.name == 'Ubuntu' - shell: bash - run: | - sudo apt -y install xvfb libasound2t64 libxcb1 libegl1 libgl1-mesa-dev libegl1-mesa-dev libglvnd0 libx11-6 libxcb-glx0 libgl1 libdbus-1-3 libxcb-xkb1 libxkbcommon-x11-0 libxcb-xkb1 libfuse2 - SCORE_FILENAME=ossia.score-master-${{ matrix.config.score }} - export SCORE_JIT_SDK="$PWD/sdk/usr" - chmod +x "$SCORE_FILENAME" + - name: Download Score SDK + uses: ossia/actions/download-score-sdk@master + if: ${{ matrix.version == 'continuous' }} + with: + version: continuous + extract-path: "${{ runner.temp }}/sdk" - find . -name '*.hpp' -exec xvfb-run --auto-servernum "./$SCORE_FILENAME" --no-gui --compile-addon {} \; + - name: JIT compile test + uses: ossia/actions/jit-compile@master + with: + score-version: ${{ matrix.version }} + sdk-path: "${{ runner.temp }}/sdk/usr" From 386a7f271536e876114b6e2b4d4da698d9cc7b2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Micha=C3=ABl=20Celerier?= Date: Sat, 19 Jul 2025 18:47:56 -0400 Subject: [PATCH 2/3] fixes --- .github/workflows/builds-dev.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/builds-dev.yaml b/.github/workflows/builds-dev.yaml index f6e17c8..04106a3 100644 --- a/.github/workflows/builds-dev.yaml +++ b/.github/workflows/builds-dev.yaml @@ -62,6 +62,7 @@ jobs: ${{ matrix.config.dependencies }} - name: Download OSSIA SDK + id: ossia-sdk uses: ossia/actions/download-ossia-sdk@master with: score-path: score @@ -72,7 +73,7 @@ jobs: addon-path: addon build-type: Debug score-path: score - ossia-sdk-path: ${{ steps.download-ossia-sdk.outputs.sdk-path }} + ossia-sdk-path: ${{ steps.ossia-sdk.outputs.sdk-path }} additional-flags: ${{ matrix.config.additional_flags }} - name: Build release @@ -81,7 +82,7 @@ jobs: addon-path: addon build-type: Release score-path: score - ossia-sdk-path: ${{ steps.download-ossia-sdk.outputs.sdk-path }} + ossia-sdk-path: ${{ steps.ossia-sdk.outputs.sdk-path }} additional-flags: ${{ matrix.config.additional_flags }} - name: Upload release From 9f2096cbace0b77130e2c5b3ad431e46d20ee86a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Micha=C3=ABl=20Celerier?= Date: Sat, 19 Jul 2025 19:40:41 -0400 Subject: [PATCH 3/3] fixes --- .github/workflows/builds-dev.yaml | 2 +- .github/workflows/builds-sdk.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/builds-dev.yaml b/.github/workflows/builds-dev.yaml index 04106a3..503b7c2 100644 --- a/.github/workflows/builds-dev.yaml +++ b/.github/workflows/builds-dev.yaml @@ -26,7 +26,7 @@ jobs: - { name: "Windows", os: windows-latest, - dependencies: "choco install -y ninja", + dependencies: "curl -L -O https://github.com/ninja-build/ninja/releases/download/v1.13.1/ninja-win.zip && unzip ninja-win.zip", additional_flags: "-GNinja" } - { diff --git a/.github/workflows/builds-sdk.yaml b/.github/workflows/builds-sdk.yaml index d9fb665..049e99a 100644 --- a/.github/workflows/builds-sdk.yaml +++ b/.github/workflows/builds-sdk.yaml @@ -26,7 +26,7 @@ jobs: - { name: "Windows", os: windows-latest, - dependencies: "choco install -y ninja", + dependencies: "curl -L -O https://github.com/ninja-build/ninja/releases/download/v1.13.1/ninja-win.zip && unzip ninja-win.zip", additional_flags: "-GNinja" } - {