diff --git a/.github/workflows/release-macos.yaml b/.github/workflows/release-macos.yaml new file mode 100644 index 0000000..e045a69 --- /dev/null +++ b/.github/workflows/release-macos.yaml @@ -0,0 +1,104 @@ +name: Release / macOS + +on: + workflow_dispatch: + push: + tags: + - '[0-9]+.[0-9]+.[0-9]+' + +env: + PJ_TAG: '3.17.2' + +jobs: + macos: + runs-on: ${{ matrix.os }} + permissions: + contents: write + concurrency: + group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.arch }} + cancel-in-progress: true + strategy: + fail-fast: false + matrix: + include: + - os: macos-14 + arch: arm64 + env: + CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_cache + + steps: + - name: Checkout PlotJuggler-Drone + uses: actions/checkout@v6 + with: + path: drone + submodules: recursive + + - name: Cache PlotJuggler install + id: cache-pj + uses: actions/cache@v5 + with: + path: pj_install + key: pj-install-macos-${{ matrix.arch }}-${{ env.PJ_TAG }} + + - name: Clone PlotJuggler ${{ env.PJ_TAG }} + if: steps.cache-pj.outputs.cache-hit != 'true' + run: | + git clone --depth 1 --branch ${{ env.PJ_TAG }} \ + https://github.com/facontidavide/PlotJuggler.git PlotJuggler + + - name: Install Qt5 via Homebrew + run: brew install qt@5 + + - name: Cache CPM packages + if: steps.cache-pj.outputs.cache-hit != 'true' + uses: actions/cache@v5 + with: + path: ${{ github.workspace }}/cpm_cache + key: cpm-macos-${{ matrix.arch }}-pj-${{ env.PJ_TAG }} + restore-keys: cpm-macos-${{ matrix.arch }}- + + - name: Configure PlotJuggler + if: steps.cache-pj.outputs.cache-hit != 'true' + run: | + cmake -S PlotJuggler -B pj_build \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/pj_install \ + "-DCMAKE_PREFIX_PATH=$(brew --prefix qt@5)" + + - name: Build PlotJuggler + if: steps.cache-pj.outputs.cache-hit != 'true' + run: cmake --build pj_build -- -j$(sysctl -n hw.logicalcpu) + + - name: Install PlotJuggler + if: steps.cache-pj.outputs.cache-hit != 'true' + run: cmake --install pj_build + + - name: Configure drone plugins + run: | + cmake -S drone -B drone_build \ + -DCMAKE_BUILD_TYPE=Release \ + -DPJ_INSTALL=${{ github.workspace }}/pj_install \ + "-DCMAKE_PREFIX_PATH=$(brew --prefix qt@5)" + + - name: Build drone plugins + run: cmake --build drone_build -- -j$(sysctl -n hw.logicalcpu) + + - name: Package plugins + run: | + SAFE_REF="${GITHUB_REF_NAME//\//-}" + ZIP_NAME="PlotJuggler-Drone-${SAFE_REF}-macOS-${{ matrix.arch }}.zip" + zip -j "$ZIP_NAME" drone_build/bin/*.dylib + echo "ZIP_NAME=$ZIP_NAME" >> "$GITHUB_ENV" + + - name: Upload artifact + uses: actions/upload-artifact@v7 + with: + name: ${{ env.ZIP_NAME }} + path: ${{ env.ZIP_NAME }} + + - name: Upload to Release + if: startsWith(github.ref, 'refs/tags/') + uses: softprops/action-gh-release@v3 + with: + files: ${{ env.ZIP_NAME }} + fail_on_unmatched_files: true diff --git a/.github/workflows/release-ubuntu.yaml b/.github/workflows/release-ubuntu.yaml new file mode 100644 index 0000000..6dac01e --- /dev/null +++ b/.github/workflows/release-ubuntu.yaml @@ -0,0 +1,109 @@ +name: Release / Ubuntu + +on: + workflow_dispatch: + push: + tags: + - '[0-9]+.[0-9]+.[0-9]+' + +env: + PJ_TAG: '3.17.2' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + ubuntu: + runs-on: ubuntu-22.04 + permissions: + contents: write + env: + CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_cache + + steps: + - name: Checkout PlotJuggler-Drone + uses: actions/checkout@v6 + with: + path: drone + submodules: recursive + + - name: Cache PlotJuggler install + id: cache-pj + uses: actions/cache@v5 + with: + path: pj_install + key: pj-install-ubuntu-${{ env.PJ_TAG }} + + - name: Clone PlotJuggler ${{ env.PJ_TAG }} + if: steps.cache-pj.outputs.cache-hit != 'true' + run: | + git clone --depth 1 --branch ${{ env.PJ_TAG }} \ + https://github.com/facontidavide/PlotJuggler.git PlotJuggler + + - name: Install Qt5 and build dependencies + run: | + sudo apt-get update + sudo apt-get install -y \ + qtbase5-dev \ + libqt5svg5-dev \ + libqt5websockets5-dev \ + libqt5opengl5-dev \ + libqt5x11extras5-dev \ + libqt5serialport5-dev \ + libprotoc-dev \ + libmosquitto-dev \ + libcurl4-openssl-dev \ + zip + + - name: Cache CPM packages + if: steps.cache-pj.outputs.cache-hit != 'true' + uses: actions/cache@v5 + with: + path: ${{ github.workspace }}/cpm_cache + key: cpm-ubuntu-pj-${{ env.PJ_TAG }} + restore-keys: cpm-ubuntu- + + - name: Configure PlotJuggler + if: steps.cache-pj.outputs.cache-hit != 'true' + run: | + cmake -S PlotJuggler -B pj_build \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/pj_install + + - name: Build PlotJuggler + if: steps.cache-pj.outputs.cache-hit != 'true' + run: cmake --build pj_build -- -j$(nproc) + + - name: Install PlotJuggler + if: steps.cache-pj.outputs.cache-hit != 'true' + run: cmake --install pj_build + + - name: Configure drone plugins + run: | + cmake -S drone -B drone_build \ + -DCMAKE_BUILD_TYPE=Release \ + -DPJ_INSTALL=${{ github.workspace }}/pj_install + + - name: Build drone plugins + run: cmake --build drone_build -- -j$(nproc) + + - name: Package plugins + run: | + SAFE_REF="${GITHUB_REF_NAME//\//-}" + ZIP_NAME="PlotJuggler-Drone-${SAFE_REF}-Ubuntu-x86_64.zip" + zip -j "$ZIP_NAME" drone_build/bin/*.so + echo "ZIP_NAME=$ZIP_NAME" >> "$GITHUB_ENV" + + - name: Upload artifact + uses: actions/upload-artifact@v7 + with: + name: ${{ env.ZIP_NAME }} + path: ${{ env.ZIP_NAME }} + + - name: Upload to Release + if: startsWith(github.ref, 'refs/tags/') + uses: softprops/action-gh-release@v3 + with: + files: ${{ env.ZIP_NAME }} + fail_on_unmatched_files: true diff --git a/.github/workflows/release-windows.yaml b/.github/workflows/release-windows.yaml new file mode 100644 index 0000000..5e58e8f --- /dev/null +++ b/.github/workflows/release-windows.yaml @@ -0,0 +1,112 @@ +name: Release / Windows + +on: + workflow_dispatch: + push: + tags: + - '[0-9]+.[0-9]+.[0-9]+' + +env: + PJ_TAG: '3.17.2' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + windows: + runs-on: windows-latest + permissions: + contents: write + env: + CXXFLAGS: /MP + CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_cache + + steps: + - name: Checkout PlotJuggler-Drone + uses: actions/checkout@v6 + with: + path: drone + submodules: recursive + + - name: Cache PlotJuggler install + id: cache-pj + uses: actions/cache@v5 + with: + path: pj_install + key: pj-install-windows-${{ env.PJ_TAG }} + + - name: Clone PlotJuggler ${{ env.PJ_TAG }} + if: steps.cache-pj.outputs.cache-hit != 'true' + shell: pwsh + run: | + git clone --depth 1 --branch ${{ env.PJ_TAG }} ` + https://github.com/facontidavide/PlotJuggler.git PlotJuggler + + - name: Install Qt + uses: jurplel/install-qt-action@v4 + with: + version: '5.15.*' + arch: 'win64_msvc2019_64' + dir: '${{ github.workspace }}/qt_installation/' + cache: 'true' + + - name: Cache CPM packages + if: steps.cache-pj.outputs.cache-hit != 'true' + uses: actions/cache@v5 + with: + path: ${{ github.workspace }}/cpm_cache + key: cpm-windows-pj-${{ env.PJ_TAG }} + restore-keys: cpm-windows- + + - name: Configure PlotJuggler + if: steps.cache-pj.outputs.cache-hit != 'true' + shell: pwsh + run: | + cmake -S PlotJuggler -B pj_build ` + -A x64 ` + -DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/pj_install" ` + -DPJ_INSTALLATION=windows ` + -DPJ_PLUGINS_DIRECTORY=bin + + - name: Build PlotJuggler + if: steps.cache-pj.outputs.cache-hit != 'true' + shell: pwsh + run: cmake --build pj_build --config Release --parallel + + - name: Install PlotJuggler + if: steps.cache-pj.outputs.cache-hit != 'true' + shell: pwsh + run: cmake --install pj_build --config Release + + - name: Configure drone plugins + shell: pwsh + run: | + cmake -S drone -B drone_build ` + -A x64 ` + "-DPJ_INSTALL=${{ github.workspace }}/pj_install" + + - name: Build drone plugins + shell: pwsh + run: cmake --build drone_build --config Release --parallel + + - name: Package plugins + shell: pwsh + run: | + $ref = "${{ github.ref_name }}" -replace '/', '-' + $zipName = "PlotJuggler-Drone-$ref-Windows-x64.zip" + Compress-Archive -Path drone_build/bin/Release/*.dll -DestinationPath $zipName + "ZIP_NAME=$zipName" | Out-File -FilePath $env:GITHUB_ENV -Append + + - name: Upload artifact + uses: actions/upload-artifact@v7 + with: + name: ${{ env.ZIP_NAME }} + path: ${{ env.ZIP_NAME }} + + - name: Upload to Release + if: startsWith(github.ref, 'refs/tags/') + uses: softprops/action-gh-release@v3 + with: + files: ${{ env.ZIP_NAME }} + fail_on_unmatched_files: true