From a643b0155d8d0de881b63cea958713145b8b61f9 Mon Sep 17 00:00:00 2001 From: Christian Heimlich Date: Sun, 14 Jul 2024 19:21:10 -0400 Subject: [PATCH 1/9] Update actions versions --- .github/workflows/build-libsquish-linux.yml | 2 +- .github/workflows/build-libsquish-windows.yml | 2 +- .github/workflows/master-pull-request-merge-reaction.yml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-libsquish-linux.yml b/.github/workflows/build-libsquish-linux.yml index b92784b..b3cc47a 100644 --- a/.github/workflows/build-libsquish-linux.yml +++ b/.github/workflows/build-libsquish-linux.yml @@ -82,7 +82,7 @@ jobs: artifact_name="$(basename "$cpack_name" .zip) [${{ matrix.cxx_comp }}]" echo "current_artifact_name=$artifact_name" >> $GITHUB_ENV - name: Upload libsquish build artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ${{ env.current_artifact_name }} path: ${{ env.libsquish_install_path }} diff --git a/.github/workflows/build-libsquish-windows.yml b/.github/workflows/build-libsquish-windows.yml index 2dab0df..c4f1cd0 100644 --- a/.github/workflows/build-libsquish-windows.yml +++ b/.github/workflows/build-libsquish-windows.yml @@ -84,7 +84,7 @@ jobs: if: matrix.lib_linkage == 'static' run: echo "doc_artifact_name=${{ env.current_artifact_name }}" >> $Env:GITHUB_OUTPUT - name: Upload libsquish build artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ${{ env.current_artifact_name }} path: ${{ env.libsquish_install_path }} diff --git a/.github/workflows/master-pull-request-merge-reaction.yml b/.github/workflows/master-pull-request-merge-reaction.yml index 5912c45..294ee10 100644 --- a/.github/workflows/master-pull-request-merge-reaction.yml +++ b/.github/workflows/master-pull-request-merge-reaction.yml @@ -77,7 +77,7 @@ jobs: path: ${{ env.doc_artifact_path }}/doc/html - name: Deploy pages artifact id: page-deployment - uses: actions/deploy-pages@v1 + uses: actions/deploy-pages@v4 create-release: name: Create GitHub release @@ -100,7 +100,7 @@ jobs: 7z a "${{ env.zips_path }}/${name}.zip" "${path}/*" } - name: Generate release - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v2 with: name: "libsquish Release v${{ needs.tag_master_and_sync_dev.outputs.new_version }}" tag_name: "v${{ needs.tag_master_and_sync_dev.outputs.new_version }}" From 8b27f8cd8dfad8cc388dd5dfa2e7e3af23a12728 Mon Sep 17 00:00:00 2001 From: Christian Heimlich Date: Sun, 14 Jul 2024 19:33:16 -0400 Subject: [PATCH 2/9] Update OBCMake --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index dfd2a6f..c585853 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,7 +19,7 @@ project(Squish # Get helper scripts include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/FetchOBCMake.cmake) -fetch_ob_cmake("v0.3") +fetch_ob_cmake("v0.3.5") # Initialize project according to standard rules include(OB/Project) From ef02ab794bec46e3af8e280822207b5744fad49a Mon Sep 17 00:00:00 2001 From: Christian Heimlich Date: Sun, 14 Jul 2024 19:41:13 -0400 Subject: [PATCH 3/9] Update checkout action --- .github/workflows/build-libsquish-linux.yml | 2 +- .github/workflows/build-libsquish-windows.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-libsquish-linux.yml b/.github/workflows/build-libsquish-linux.yml index b3cc47a..bee8f11 100644 --- a/.github/workflows/build-libsquish-linux.yml +++ b/.github/workflows/build-libsquish-linux.yml @@ -55,7 +55,7 @@ jobs: - name: Install Ninja run: sudo apt-get install ninja-build - name: Checkout libsquish - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: path: ${{ env.libsquish_src_suffix }} fetch-depth: 0 # Required for verbose versioning to work correctly diff --git a/.github/workflows/build-libsquish-windows.yml b/.github/workflows/build-libsquish-windows.yml index c4f1cd0..fcdbbaa 100644 --- a/.github/workflows/build-libsquish-windows.yml +++ b/.github/workflows/build-libsquish-windows.yml @@ -51,7 +51,7 @@ jobs: - name: Install Graphviz run: choco install graphviz - name: Checkout libsquish - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: path: ${{ env.libsquish_src_suffix }} fetch-depth: 0 # Required for verbose versioning to work correctly From 15c637e75d51d79317510da745af03fbd0a8cf7d Mon Sep 17 00:00:00 2001 From: Christian Heimlich Date: Sun, 14 Jul 2024 19:50:20 -0400 Subject: [PATCH 4/9] Actions: Simplify matrix for Linux --- .github/workflows/build-libsquish-linux.yml | 38 +++++++-------------- 1 file changed, 13 insertions(+), 25 deletions(-) diff --git a/.github/workflows/build-libsquish-linux.yml b/.github/workflows/build-libsquish-linux.yml index bee8f11..7c235c6 100644 --- a/.github/workflows/build-libsquish-linux.yml +++ b/.github/workflows/build-libsquish-linux.yml @@ -14,29 +14,17 @@ jobs: fail-fast: false matrix: os: [ubuntu-20.04, ubuntu-22.04] - compiler: [gcc, clang] - lib_linkage: [shared, static] - include: - - os: ubuntu-20.04 - compiler: gcc - c_comp: gcc-10 - cxx_comp: g++-10 - - os: ubuntu-20.04 - compiler: clang - c_comp: clang-12 - cxx_comp: clang++-12 - - os: ubuntu-22.04 - compiler: gcc - c_comp: gcc-12 - cxx_comp: g++-12 - - os: ubuntu-22.04 - compiler: clang - c_comp: clang-14 - cxx_comp: clang++-14 - - lib_linkage: shared - cmake_bsl: ON - - lib_linkage: static - cmake_bsl: OFF + compiler: [{c: gcc-10, cxx: g++-10, qt: clang12}, {c: gcc-12, cxx: g++-12, qt: clang14}, {c: clang-12, cxx: clang++-12, qt: clang12}, {c: clang-14, cxx: clang++-14, qt: clang14}] + linkage: [{type: shared, cmake_bsl: ON}, {type: static, cmake_bsl: OFF}] + exclude: + - os: ubuntu-20.04 + compiler: {c: gcc-12, cxx: g++-12, qt: clang14} + - os: ubuntu-20.04 + compiler: {c: clang-14, cxx: clang++-14, qt: clang14} + - os: ubuntu-22.04 + compiler: {c: gcc-10, cxx: g++-10, qt: clang12} + - os: ubuntu-22.04 + compiler: {c: clang-12, cxx: clang++-12, qt: clang12} runs-on: ${{ matrix.os }} env: cmake_gen: Ninja Multi-Config @@ -63,7 +51,7 @@ jobs: working-directory: ${{ env.libsquish_src_dir }} run: | echo Configuring CMake... - cmake -G "$cmake_gen" -S "$libsquish_src_dir" -B "$libsquish_build_dir" -D CMAKE_CXX_COMPILER="${{ matrix.cxx_comp }}" -D CMAKE_C_COMPILER="${{ matrix.c_comp }}" -D BUILD_SHARED_LIBS="${{ matrix.cmake_bsl }}" -D LIBSQUISH_TESTS=ON -D LIBSQUISH_DOCS=ON -D LIBSQUISH_EXTRAS=ON + cmake -G "$cmake_gen" -S "$libsquish_src_dir" -B "$libsquish_build_dir" -D CMAKE_CXX_COMPILER="${{ matrix.compiler.cxx }}" -D CMAKE_C_COMPILER="${{ matrix.compiler.c }}" -D BUILD_SHARED_LIBS="${{ matrix.linkage.cmake_bsl }}" -D LIBSQUISH_TESTS=ON -D LIBSQUISH_DOCS=ON -D LIBSQUISH_EXTRAS=ON echo Changing to build directory... cd "$libsquish_build_dir" echo Building libsquish Release/Docs... @@ -79,7 +67,7 @@ jobs: id: get_artifact_name run: | cpack_name=$(find "${{ env.libsquish_package_path }}" -type f -name "*.zip") - artifact_name="$(basename "$cpack_name" .zip) [${{ matrix.cxx_comp }}]" + artifact_name="$(basename "$cpack_name" .zip) [${{ matrix.compiler.cxx }}]" echo "current_artifact_name=$artifact_name" >> $GITHUB_ENV - name: Upload libsquish build artifact uses: actions/upload-artifact@v4 From 45e83c8f2980e94263bb215d2f1ec8b12f1c9488 Mon Sep 17 00:00:00 2001 From: Christian Heimlich Date: Sun, 1 Sep 2024 15:37:10 -0400 Subject: [PATCH 5/9] Switch to reusable workflows --- .github/workflows/build-libsquish-linux.yml | 77 ------------ .github/workflows/build-libsquish-windows.yml | 91 -------------- .github/workflows/build-project.yml | 21 ++++ .github/workflows/check-release-pr.yml | 10 ++ .github/workflows/generate-release.yml | 19 +++ .github/workflows/label-pr.yml | 12 ++ .../workflows/master-pull-request-checks.yml | 13 -- .../master-pull-request-merge-reaction.yml | 112 ------------------ .github/workflows/pull-request-labeler.yml | 13 -- .github/workflows/push-reaction.yml | 17 --- .../tag-release-commit-and-sync-dev.yml | 14 +++ 11 files changed, 76 insertions(+), 323 deletions(-) delete mode 100644 .github/workflows/build-libsquish-linux.yml delete mode 100644 .github/workflows/build-libsquish-windows.yml create mode 100644 .github/workflows/build-project.yml create mode 100644 .github/workflows/check-release-pr.yml create mode 100644 .github/workflows/generate-release.yml create mode 100644 .github/workflows/label-pr.yml delete mode 100644 .github/workflows/master-pull-request-checks.yml delete mode 100644 .github/workflows/master-pull-request-merge-reaction.yml delete mode 100644 .github/workflows/pull-request-labeler.yml delete mode 100644 .github/workflows/push-reaction.yml create mode 100644 .github/workflows/tag-release-commit-and-sync-dev.yml diff --git a/.github/workflows/build-libsquish-linux.yml b/.github/workflows/build-libsquish-linux.yml deleted file mode 100644 index 7c235c6..0000000 --- a/.github/workflows/build-libsquish-linux.yml +++ /dev/null @@ -1,77 +0,0 @@ -name: Build libsquish - Linux -on: - workflow_call: - -env: - libsquish_src_suffix: libsquish/Source - libsquish_src_dir: ${{ github.workspace }}/libsquish/Source - libsquish_build_dir: ${{ github.workspace }}/libsquish/Build - -jobs: - build-libsquish: - name: Build libsquish - Linux (Release) - strategy: - fail-fast: false - matrix: - os: [ubuntu-20.04, ubuntu-22.04] - compiler: [{c: gcc-10, cxx: g++-10, qt: clang12}, {c: gcc-12, cxx: g++-12, qt: clang14}, {c: clang-12, cxx: clang++-12, qt: clang12}, {c: clang-14, cxx: clang++-14, qt: clang14}] - linkage: [{type: shared, cmake_bsl: ON}, {type: static, cmake_bsl: OFF}] - exclude: - - os: ubuntu-20.04 - compiler: {c: gcc-12, cxx: g++-12, qt: clang14} - - os: ubuntu-20.04 - compiler: {c: clang-14, cxx: clang++-14, qt: clang14} - - os: ubuntu-22.04 - compiler: {c: gcc-10, cxx: g++-10, qt: clang12} - - os: ubuntu-22.04 - compiler: {c: clang-12, cxx: clang++-12, qt: clang12} - runs-on: ${{ matrix.os }} - env: - cmake_gen: Ninja Multi-Config - steps: - - name: Set derived variables with shell because GitHub Actions env context sucks - run: | - echo "libsquish_package_path=${{ env.libsquish_build_dir }}/out/dist" >> $GITHUB_ENV - libsquish_install_path="${{ env.libsquish_build_dir }}/out/install" - echo "libsquish_install_path=$libsquish_install_path" >> $GITHUB_ENV - - name: Install Doxygen - uses: oblivioncth/actions/ubuntu/install-doxygen-from-sourceforge@dev - with: - version: 1.9.4 - - name: Install Graphviz - run: sudo apt-get install graphviz - - name: Install Ninja - run: sudo apt-get install ninja-build - - name: Checkout libsquish - uses: actions/checkout@v4 - with: - path: ${{ env.libsquish_src_suffix }} - fetch-depth: 0 # Required for verbose versioning to work correctly - - name: Build/Install libsquish - working-directory: ${{ env.libsquish_src_dir }} - run: | - echo Configuring CMake... - cmake -G "$cmake_gen" -S "$libsquish_src_dir" -B "$libsquish_build_dir" -D CMAKE_CXX_COMPILER="${{ matrix.compiler.cxx }}" -D CMAKE_C_COMPILER="${{ matrix.compiler.c }}" -D BUILD_SHARED_LIBS="${{ matrix.linkage.cmake_bsl }}" -D LIBSQUISH_TESTS=ON -D LIBSQUISH_DOCS=ON -D LIBSQUISH_EXTRAS=ON - echo Changing to build directory... - cd "$libsquish_build_dir" - echo Building libsquish Release/Docs... - cmake --build . --target all --config Release - echo Installing libsquish Release/Docs - cmake --install . --config Release - echo Running tests... - ctest -C Release --output-on-failure - echo Packaging libsquish... - cpack -C "Release" - echo Build complete. - - name: Get libsquish artifact name - id: get_artifact_name - run: | - cpack_name=$(find "${{ env.libsquish_package_path }}" -type f -name "*.zip") - artifact_name="$(basename "$cpack_name" .zip) [${{ matrix.compiler.cxx }}]" - echo "current_artifact_name=$artifact_name" >> $GITHUB_ENV - - name: Upload libsquish build artifact - uses: actions/upload-artifact@v4 - with: - name: ${{ env.current_artifact_name }} - path: ${{ env.libsquish_install_path }} - if-no-files-found: error diff --git a/.github/workflows/build-libsquish-windows.yml b/.github/workflows/build-libsquish-windows.yml deleted file mode 100644 index fcdbbaa..0000000 --- a/.github/workflows/build-libsquish-windows.yml +++ /dev/null @@ -1,91 +0,0 @@ -name: Build libsquish - Windows -on: - workflow_call: - secrets: - ffynnon_cred: - description: 'Credentials for using Ffynnon-based actions' - required: true - outputs: - doc_artifact_name: - description: "Name of artifact used to update docs" - value: ${{ jobs.build-libsquish.outputs.doc_artifact_name }} -env: - libsquish_src_suffix: libsquish/Source - libsquish_src_dir: ${{ github.workspace }}/libsquish/Source - libsquish_build_dir: ${{ github.workspace }}/libsquish/Build - -jobs: - build-libsquish: - name: Build libsquish - Windows (Release) - strategy: - fail-fast: false - matrix: - lib_linkage: [shared, static] - include: - - lib_linkage: shared - cmake_bsl: ON - vcpkg_triplet: x64-windows - - lib_linkage: static - cmake_bsl: OFF - vcpkg_triplet: x64-windows-static - runs-on: windows-latest - env: - vs_dir: C:/Program Files/Microsoft Visual Studio/2022/Enterprise - cmake_gen: Ninja Multi-Config - outputs: - doc_artifact_name: ${{ steps.set_doc_artifact_name.outputs.doc_artifact_name }} - steps: - - name: Set derived variables with shell because GitHub Actions env context sucks - run: | - echo "libsquish_package_path=${{ env.libsquish_build_dir }}/out/dist" >> $Env:GITHUB_ENV - $libsquish_install_path="${{ env.libsquish_build_dir }}/out/install" - echo "libsquish_install_path=$libsquish_install_path" >> $Env:GITHUB_ENV - - name: Install libpng - run: vcpkg install libpng:${{ matrix.vcpkg_triplet }} - - name: Install Doxygen - uses: oblivioncth/actions/general/cache-and-install-doxygen-from-ffynnon@dev - with: - version: 1.9.4 - os: windows - credentials: ${{ secrets.ffynnon_cred }} - - name: Install Graphviz - run: choco install graphviz - - name: Checkout libsquish - uses: actions/checkout@v4 - with: - path: ${{ env.libsquish_src_suffix }} - fetch-depth: 0 # Required for verbose versioning to work correctly - - name: Build/Install libsquish - working-directory: ${{ env.libsquish_src_dir }} - shell: cmd - run: | - echo "Setup C++ Build Environment..." - CALL "${{ env.vs_dir }}\Common7\Tools\VsDevCmd.bat" -arch=amd64 - echo "Add vcpkg Toolchain Env Variable" - set "CMAKE_TOOLCHAIN_FILE=%VCPKG_INSTALLATION_ROOT%/scripts/buildsystems/vcpkg.cmake" - cmake -G "${{ env.cmake_gen }}" -S "${{ env.libsquish_src_dir}}" -B "${{ env.libsquish_build_dir }}" -D BUILD_SHARED_LIBS=${{ matrix.cmake_bsl }} -D LIBSQUISH_TESTS=ON -D LIBSQUISH_DOCS=ON -D LIBSQUISH_EXTRAS=ON -D VCPKG_TARGET_TRIPLET=${{ matrix.vcpkg_triplet }} - echo "Changing to build directory..." - cd "%libsquish_build_dir%" - echo "Building libsquish Release/Docs..." - cmake --build . --target all --config Release - echo "Installing libsquish Release/Docs..." - cmake --install . --config Release - echo "Running tests..." - ctest -C Release --output-on-failure - echo "Packaging libsquish..." - cpack -C "Release" - echo "Build complete." - - name: Get libsquish artifact name - run: | - $artifact_name=$((Get-ChildItem -Path "${{ env.libsquish_package_path }}" -Filter *.zip)[0].BaseName) - echo "current_artifact_name=$artifact_name" >> $Env:GITHUB_ENV - - name: Set doc artifact name - id: set_doc_artifact_name - if: matrix.lib_linkage == 'static' - run: echo "doc_artifact_name=${{ env.current_artifact_name }}" >> $Env:GITHUB_OUTPUT - - name: Upload libsquish build artifact - uses: actions/upload-artifact@v4 - with: - name: ${{ env.current_artifact_name }} - path: ${{ env.libsquish_install_path }} - if-no-files-found: error diff --git a/.github/workflows/build-project.yml b/.github/workflows/build-project.yml new file mode 100644 index 0000000..ac71ffe --- /dev/null +++ b/.github/workflows/build-project.yml @@ -0,0 +1,21 @@ +name: Build Project +on: + workflow_dispatch: + push: + branches-ignore: + - 'master' + workflow_run: + workflows: Tag and Sync + types: completed + branches: dev + # This is the branch that the original workflow ran on, which is technically dev, due to how + # the "pull_request" trigger works (it works off master correctly for a merged PR but is triggered + # by dev + +jobs: + trigger-build: + name: Build Project + if: github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' + uses: oblivioncth/actions/.github/workflows/build-cxx-project.yml@v1 + secrets: + ffynnon_access: ${{ secrets.OBYBOT_FFYNNON_ACCESS }} diff --git a/.github/workflows/check-release-pr.yml b/.github/workflows/check-release-pr.yml new file mode 100644 index 0000000..ec28ae1 --- /dev/null +++ b/.github/workflows/check-release-pr.yml @@ -0,0 +1,10 @@ +name: Check Release PR +on: + pull_request: + types: [opened, synchronize, reopened] + branches: master + +jobs: + check-pr-correctness: + name: Release PR Correctness Check + uses: oblivioncth/actions/.github/workflows/validate-release-pr.yml@v1 diff --git a/.github/workflows/generate-release.yml b/.github/workflows/generate-release.yml new file mode 100644 index 0000000..db607da --- /dev/null +++ b/.github/workflows/generate-release.yml @@ -0,0 +1,19 @@ +name: Generate Release +on: + workflow_run: + workflows: Build Project + types: completed + branches: master + +jobs: + generate-release: + name: Generate Release + permissions: + actions: read + contents: write + pages: write + id-token: write + if: github.event.workflow_run.conclusion == 'success' + uses: oblivioncth/actions/.github/workflows/generate-cxx-release.yml@v1 + with: + artifacts_run_id: ${{ github.event.workflow_run.id }} diff --git a/.github/workflows/label-pr.yml b/.github/workflows/label-pr.yml new file mode 100644 index 0000000..a53d957 --- /dev/null +++ b/.github/workflows/label-pr.yml @@ -0,0 +1,12 @@ +name: Label PR +on: + pull_request_target: + types: [opened, synchronize, reopened] + +jobs: + label-pr: + name: Label pull-request + permissions: + contents: read + pull-requests: write + uses: oblivioncth/actions/.github/workflows/label-pr.yml@v1 diff --git a/.github/workflows/master-pull-request-checks.yml b/.github/workflows/master-pull-request-checks.yml deleted file mode 100644 index f434e64..0000000 --- a/.github/workflows/master-pull-request-checks.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: Master pull-request checks -on: - pull_request: - types: [opened, synchronize, reopened] - branches: master - -jobs: - check-pr-correctness: - name: Master PR correctness check - runs-on: windows-latest - steps: - - name: Ensure higher version - uses: oblivioncth/actions/cmake/ensure-project-version-gt-tag@dev \ No newline at end of file diff --git a/.github/workflows/master-pull-request-merge-reaction.yml b/.github/workflows/master-pull-request-merge-reaction.yml deleted file mode 100644 index 294ee10..0000000 --- a/.github/workflows/master-pull-request-merge-reaction.yml +++ /dev/null @@ -1,112 +0,0 @@ -name: Master pull-request merge reaction -on: - pull_request: - types: [closed] - branches: - - 'master' -env: - doc_artifact_path: ${{ github.workspace }}/DocArtifact - artifacts_path: ${{ github.workspace }}/Artifacts - zips_path: ${{ github.workspace }}/Zips - -jobs: - tag_master_and_sync_dev: - name: Tag master merge commit, FF back to dev - if: github.event.pull_request.merged == true - runs-on: windows-latest - outputs: - new_version: ${{ steps.get-proj-ver.outputs.version }} - steps: - - name: Get project version - id: get-proj-ver - uses: oblivioncth/actions/cmake/get-project-version@dev - - name: Set Git user to ObyBotCI - uses: oblivioncth/actions/git/set-git-user-to-oby-bot@dev - - name: Tag master with new version tag - uses: oblivioncth/actions/git/tag@dev - with: - tag: 'v${{ steps.get-proj-ver.outputs.version }}' - message: 'Release v${{ steps.get-proj-ver.outputs.version }}' - - name: Move 'latest' tag - uses: oblivioncth/actions/git/move-latest-tag@dev - - name: Fast-forward merge master into to dev - if: always() - uses: oblivioncth/actions/git/merge-branches@dev - with: - source_branch: master - target_branch: dev - ff: only - - build_libsquish_release_windows: - name: Build libsquish Release (Windows) - needs: tag_master_and_sync_dev - if: github.event.pull_request.merged == true - uses: ./.github/workflows/build-libsquish-windows.yml - secrets: - ffynnon_cred: ${{ secrets.OBYBOT_FFYNNON_CREDS }} - - build_libsquish_release_linux: - name: Build libsquish Release (Linux) - needs: tag_master_and_sync_dev - if: github.event.pull_request.merged == true - uses: ./.github/workflows/build-libsquish-linux.yml - - update-docs: - name: Update gh-pages - needs: [build_libsquish_release_windows] - if: github.event.pull_request.merged == true - permissions: - contents: read - pages: write - id-token: write - environment: - name: github-pages - url: ${{ steps.page-deployment.outputs.page_url }} - runs-on: ubuntu-latest - steps: - - name: Download built static libsquish artifact - uses: actions/download-artifact@v3 - with: - name: ${{ needs.build_libsquish_release_windows.outputs.doc_artifact_name }} - path: ${{ env.doc_artifact_path }} - - name: Setup pages - uses: actions/configure-pages@v3 - - name: Upload pages artifact - uses: actions/upload-pages-artifact@v1 - with: - path: ${{ env.doc_artifact_path }}/doc/html - - name: Deploy pages artifact - id: page-deployment - uses: actions/deploy-pages@v4 - - create-release: - name: Create GitHub release - needs: [update-docs, build_libsquish_release_windows, build_libsquish_release_linux, tag_master_and_sync_dev] - if: github.event.pull_request.merged == true - runs-on: ubuntu-latest - steps: - - name: Download built libsquish artifacts - uses: actions/download-artifact@v3 - with: - path: ${{ env.artifacts_path }} - - name: Zip up release artifacts - shell: pwsh - run: | - $artifact_folders = Get-ChildItem -Directory -Path "${{ env.artifacts_path }}" -Exclude "github-pages" - foreach($art_dir in $artifact_folders) - { - $name = $art_dir.name - $path = $art_dir.fullname - 7z a "${{ env.zips_path }}/${name}.zip" "${path}/*" - } - - name: Generate release - uses: softprops/action-gh-release@v2 - with: - name: "libsquish Release v${{ needs.tag_master_and_sync_dev.outputs.new_version }}" - tag_name: "v${{ needs.tag_master_and_sync_dev.outputs.new_version }}" - fail_on_unmatched_files: true - generate_release_notes: true - files: | - ${{ env.zips_path }}/*.zip - - \ No newline at end of file diff --git a/.github/workflows/pull-request-labeler.yml b/.github/workflows/pull-request-labeler.yml deleted file mode 100644 index 55df907..0000000 --- a/.github/workflows/pull-request-labeler.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: Pull-request auto-labeler -on: - pull_request: - types: [opened] - -jobs: - label_pr: - name: Label pull-request - runs-on: ubuntu-latest - steps: - - name: Label via convention - uses: oblivioncth/actions/pull-request/label-pr-conventionally@dev - \ No newline at end of file diff --git a/.github/workflows/push-reaction.yml b/.github/workflows/push-reaction.yml deleted file mode 100644 index 889c982..0000000 --- a/.github/workflows/push-reaction.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: libsquish Push Reaction -on: - workflow_dispatch: - push: - branches-ignore: - - 'master' - -jobs: - trigger-windows-build: - name: Build libsquish (Windows) - uses: ./.github/workflows/build-libsquish-windows.yml - secrets: - ffynnon_cred: ${{ secrets.OBYBOT_FFYNNON_CREDS }} - - trigger-linux-build: - name: Build libsquish (Linux) - uses: ./.github/workflows/build-libsquish-linux.yml \ No newline at end of file diff --git a/.github/workflows/tag-release-commit-and-sync-dev.yml b/.github/workflows/tag-release-commit-and-sync-dev.yml new file mode 100644 index 0000000..c2589c1 --- /dev/null +++ b/.github/workflows/tag-release-commit-and-sync-dev.yml @@ -0,0 +1,14 @@ +name: Tag and Sync +on: + pull_request: + types: [closed] + branches: + - 'master' + +jobs: + tag-master-and-sync-dev: + name: Tag master merge commit, FF back to dev + if: github.event.pull_request.merged == true + permissions: + contents: write + uses: oblivioncth/actions/.github/workflows/tag-main-and-sync-dev.yml@v1 From 79258ee2ba2a282392c4258e746c2f471dd08bb1 Mon Sep 17 00:00:00 2001 From: Christian Heimlich Date: Sun, 1 Sep 2024 18:45:13 -0400 Subject: [PATCH 6/9] Don't try to find C component of OpenMP None of the code in this library is pure C and as such no C compiler is ever used; therefore, all of the 'C' specific aspects of CMake's FindOpenMP module are irrelevant and trying to find them actually causes OpenMP support to break. This is because the original CMake scripts, which were for < 3.0 did not make use of the `LANGUAGES` part of the project() command, as it did not exist. FindOpenMP automatically considers a language component to not be found if that language was not specified to be a part of the project via `project()` or `enable_language()`, both of which did not exist prior to 3.0. Since we now explicitly enable only the `CXX` language, OpenMP was always considered to be "NOT_FOUND". Drop checks for the 'C' component since it is not used anyway. --- CMakeLists.txt | 2 +- lib/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c585853..88da8f1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -44,7 +44,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) # Import OpenMP if(LIBSQUISH_USE_OPENMP) - find_package(OpenMP COMPONENTS C CXX) + find_package(OpenMP COMPONENTS CXX) endif() # Target - Lib diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 53f4243..0581da0 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -7,7 +7,7 @@ set(squish_defs "") set(squish_opts "") if(LIBSQUISH_USE_OPENMP AND OpenMP_FOUND) - list(APPEND squish_links "OpenMP::OpenMP_C OpenMP::OpenMP_CXX") + list(APPEND squish_links "OpenMP::OpenMP_CXX") list(APPEND squish_defs "SQUISH_USE_OPENMP") endif() From 727685ff917aa7c75e3ba4e0267759045ff7bced Mon Sep 17 00:00:00 2001 From: Christian Heimlich Date: Sun, 1 Sep 2024 20:22:51 -0400 Subject: [PATCH 7/9] Update mainpage.md.in, fix header levels --- doc/cmake/file_templates/mainpage.md.in | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/doc/cmake/file_templates/mainpage.md.in b/doc/cmake/file_templates/mainpage.md.in index 043db98..6695a45 100644 --- a/doc/cmake/file_templates/mainpage.md.in +++ b/doc/cmake/file_templates/mainpage.md.in @@ -33,7 +33,7 @@ Packaging ---------- libsquish is provided as a CMake package composed of a single library and accompanying public header file, along with a couple optional executables. -#### Package Components: +### Package Components: - `Squish` - The main library - `Generator` - The color lookup table generator application @@ -151,7 +151,7 @@ The requirements for building from source are the same as for using libsquish, w It is recommended to use a multi-configuration generators such as Ninja Multi-Config or Visual Studio. -#### CMake Options: +### CMake Options: - `LIBSQUISH_USE_OPENMP` - Build libsquish using the OpenMP parallelization library (ON) - `LIBSQUISH_USE_SSE2` - Build libsquish using the SSE2 extended x86 instructions (ON) - `LIBSQUISH_USE_ALTIVEC` - Build libsquish using PPC AltiVec instructions (OFF) @@ -160,7 +160,7 @@ It is recommended to use a multi-configuration generators such as Ninja Multi-C - `LIBSQUISH_TESTS` - Enable the libsquish test targets (OFF) - `BUILD_SHARED_LIBS` - Build libsquish as a shared library instead of a static one (OFF) -#### CMake Targets: +### CMake Targets: - `all` - Builds the library, documentation if enabled, and 'extra' executables if enabled - `install` - Installs the build output into `CMAKE_INSTALL_PREFIX` @@ -170,7 +170,7 @@ It is recommended to use a multi-configuration generators such as Ninja Multi-C - `libsquish_png` - Builds the PNG compressor demo - `libsquish_tst_...` - Builds test targets. To actually run tests, just build the general CMake tests target `test`. -#### CMake Install Components: +### CMake Install Components: - `libsquish` - Installs top-level files (README.md, CMake package configuration files, etc.) - `libsquish_docs` - Installs the libsquish documentation @@ -180,13 +180,16 @@ It is recommended to use a multi-configuration generators such as Ninja Multi-C If libsquish is configured as a sub-project, its install components are automatically removed from the default install component, as to not pollute the install directory of the top-level project. They can still be installed by directly referencing their component names as shown above. -#### Documentation: +### Documentation: In order for the `@DOC_TARGET_NAME@` target to be generated the CMake cache variable **LIBSQUISH_DOCS** must be set to *ON* when CMake is invoked: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cmake.exe (...) -D LIBSQUISH_DOCS=ON ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -#### Package +### Tests: +The project contains a suite of tests to ensure that the library functions as intended. + +### Package By default, the project configures CPack to create an artifact ZIP containing all installed components. The following is the general build process required to successfully generate this package via a shadow build on Windows: From b16fcebcbaff2ceb1eef6458d7cba46de3c443e8 Mon Sep 17 00:00:00 2001 From: Christian Heimlich Date: Sun, 1 Sep 2024 21:23:31 -0400 Subject: [PATCH 8/9] Ensure OpenMP is available --- .github/workflows/build-project.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/build-project.yml b/.github/workflows/build-project.yml index ac71ffe..c4a7005 100644 --- a/.github/workflows/build-project.yml +++ b/.github/workflows/build-project.yml @@ -19,3 +19,16 @@ jobs: uses: oblivioncth/actions/.github/workflows/build-cxx-project.yml@v1 secrets: ffynnon_access: ${{ secrets.OBYBOT_FFYNNON_ACCESS }} + with: + pre_build_steps: | + - name: Install OpenMP lib [Linux] + if: env.run_is_linux == 'true' + shell: pwsh + run: | + if($Env:run_compiler.StartsWith('g++-')) { + sudo apt-get install libgomp1 + } elseif($Env:run_compiler.StartsWith('clang++-')) { + $ver = $Env:run_compiler.replace('clang++-', '') + $pkg = "libomp-${ver}-dev" + sudo apt-get install $pkg + } From 464647a3180c92bcf17e3b29da8ba4e4b1a96145 Mon Sep 17 00:00:00 2001 From: Christian Heimlich Date: Sun, 1 Sep 2024 23:21:09 -0400 Subject: [PATCH 9/9] Bump --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 88da8f1..6832596 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,7 +12,7 @@ cmake_minimum_required(VERSION 3.23.0...3.26.0) # Project # NOTE: DON'T USE TRAILING ZEROS IN VERSIONS project(Squish - VERSION 1.15.1.1 + VERSION 1.15.1.2 LANGUAGES CXX DESCRIPTION "S3TC/DXT compliant image compression" )