diff --git a/.github/workflows/build-clifp-linux.yml b/.github/workflows/build-clifp-linux.yml deleted file mode 100644 index 6c95f64..0000000 --- a/.github/workflows/build-clifp-linux.yml +++ /dev/null @@ -1,104 +0,0 @@ -name: Build CLIFp - Linux -on: - workflow_call: - secrets: - qt_ffynnon_cred: - description: 'Credentials for getting Qt from Ffynnon' - required: true -env: - qt_install_dir: ${{ github.workspace }}/Qt/Install - clifp_src_suffix: CLIFp/Source - clifp_src_dir: ${{ github.workspace }}/CLIFp/Source - clifp_build_dir: ${{ github.workspace }}/CLIFp/Build - -jobs: - build-clifp: - name: Build CLIFp - Linux (Release) - strategy: - fail-fast: false - matrix: - os: [ubuntu-20.04, ubuntu-22.04] - compiler: [{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: 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 "clifp_package_path=${{ env.clifp_build_dir }}/out/dist" >> $GITHUB_ENV - clifp_install_path="${{ env.clifp_build_dir }}/out/install" - echo "clifp_install_path=$clifp_install_path" >> $GITHUB_ENV - echo "qt_cmake=$qt_install_dir/bin/qt-cmake" >> $GITHUB_ENV - - name: Install Qt (custom build) - uses: oblivioncth/actions/general/install-and-cache-qt-from-ffynnon@dev - with: - version: 6.7.2 - os: linux - compiler: ${{ matrix.compiler.qt }} - linkage: ${{ matrix.linkage.type }} - path: ${{ env.qt_install_dir }} - credentials: ${{ secrets.qt_ffynnon_cred }} - - name: Update package index - run: sudo apt-get update - - name: Install OpenGL lib - run: sudo apt-get install libglu1-mesa-dev - - name: Install XCB Related libs - run: sudo apt-get install libx11-xcb-dev libxkbcommon-dev libxkbcommon-x11-dev libxcb-*-dev - - name: Install libdrm - run: sudo apt-get install libdrm-dev - - name: Install Ninja - run: sudo apt-get install ninja-build - - name: Install Harfbuzz - run: sudo apt-get install libharfbuzz-dev - - name: Install EGL [22.04] - if: matrix.os == 'ubuntu-22.04' - run: sudo apt-get install libegl1-mesa-dev - - name: Install Wayland - run: sudo apt-get install libwayland-dev - - name: Install DBus [22.04] - if: matrix.os == 'ubuntu-22.04' - run: sudo apt-get install libdbus-1-dev - - name: Install libzstd-dev - run: sudo apt-get install libzstd-dev - - name: Install libdbus-1-dev - run: sudo apt-get install libdbus-1-dev - - name: Install libbrotli-dev - run: sudo apt-get install libbrotli-dev - - name: Checkout CLIFp - uses: actions/checkout@v4 - with: - path: ${{ env.clifp_src_suffix }} - fetch-depth: 0 # Required for verbose versioning to work correctly - - name: Build/Install CLIFp - working-directory: ${{ env.clifp_src_dir }} - run: | - echo Configuring CMake... - "$qt_cmake" -G "$cmake_gen" -S "$clifp_src_dir" -B "$clifp_build_dir" -D BUILD_SHARED_LIBS="${{ matrix.linkage.cmake_bsl }}" -D CMAKE_CXX_COMPILER="${{ matrix.compiler.cxx }}" -D CMAKE_C_COMPILER="${{ matrix.compiler.c }}" - echo Changing to build directory... - cd "$clifp_build_dir" - echo Building CLIFp Release... - cmake --build . --target all --config Release - echo Installing CLIFp Release - cmake --install . --config Release - echo Packaging CLIFp... - cpack -C "Release" - echo Build complete. - - name: Get CLIFp artifact name - run: | - cpack_name=$(find "${{ env.clifp_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 CLIFp build artifact - uses: actions/upload-artifact@v4 - with: - name: ${{ env.current_artifact_name }} - path: ${{ env.clifp_install_path }} - if-no-files-found: error diff --git a/.github/workflows/build-clifp-windows.yml b/.github/workflows/build-clifp-windows.yml deleted file mode 100644 index eb6f224..0000000 --- a/.github/workflows/build-clifp-windows.yml +++ /dev/null @@ -1,72 +0,0 @@ -name: Build CLIFp - Windows -on: - workflow_call: - secrets: - qt_ffynnon_cred: - description: 'Credentials for getting Qt from Ffynnon' - required: true -env: - qt_install_dir: ${{ github.workspace }}/Qt/Install - clifp_src_suffix: CLIFp/Source - clifp_src_dir: ${{ github.workspace }}/CLIFp/Source - clifp_build_dir: ${{ github.workspace }}/CLIFp/Build - -jobs: - build-clifp: - name: Build CLIFp - Windows (Release) - strategy: - fail-fast: false - matrix: - linkage: [{type: shared, cmake_bsl: ON}, {type: static, cmake_bsl: OFF}] - runs-on: windows-latest - env: - vs_dir: C:/Program Files/Microsoft Visual Studio/2022/Enterprise - cmake_gen: Ninja Multi-Config - steps: - - name: Set derived variables with shell because GitHub Actions env context sucks - run: | - echo "clifp_package_path=${{ env.clifp_build_dir }}/out/dist" >> $Env:GITHUB_ENV - $clifp_install_path="${{ env.clifp_build_dir }}/out/install" - echo "clifp_install_path=$clifp_install_path" >> $Env:GITHUB_ENV - echo "qt_cmake=${Env:qt_install_dir}/bin/qt-cmake.bat" >> $Env:GITHUB_ENV - - name: Install Qt (custom build) - uses: oblivioncth/actions/general/install-and-cache-qt-from-ffynnon@dev - with: - version: 6.7.2 - os: windows - compiler: msvc2022 - linkage: ${{ matrix.linkage.type }} - path: ${{ env.qt_install_dir }} - credentials: ${{ secrets.qt_ffynnon_cred }} - - name: Checkout CLIFp - uses: actions/checkout@v4 - with: - path: ${{ env.clifp_src_suffix }} - fetch-depth: 0 # Required for verbose versioning to work correctly - - name: Build/Install CLIFp - working-directory: ${{ env.clifp_src_dir }} - shell: cmd - run: | - echo "Setup C++ Build Environment..." - CALL "${{ env.vs_dir }}\Common7\Tools\VsDevCmd.bat" -arch=amd64 - echo "Configure CMake using Qt wrapper..." - CALL "${{ env.qt_cmake }}" -G "${{ env.cmake_gen }}" -S "${{ env.clifp_src_dir}}" -B "${{ env.clifp_build_dir }}" -D BUILD_SHARED_LIBS=${{ matrix.linkage.cmake_bsl }} - echo "Changing to build directory..." - cd "%clifp_build_dir%" - echo "Building CLIFp release..." - cmake --build . --target all --config Release - echo "Installing CLIFp Release..." - cmake --install . --config Release - echo "Packaging CLIFp..." - cpack -C "Release" - echo "Build complete." - - name: Get CLIFp artifact name - run: | - $artifact_name=$((Get-ChildItem -Path "${{ env.clifp_package_path }}" -Filter *.zip)[0].BaseName) + ' [msvc]' - echo "current_artifact_name=$artifact_name" >> $Env:GITHUB_ENV - - name: Upload CLIFp build artifact - uses: actions/upload-artifact@v4 - with: - name: ${{ env.current_artifact_name }} - path: ${{ env.clifp_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..cd7189d --- /dev/null +++ b/.github/workflows/generate-release.yml @@ -0,0 +1,74 @@ +name: Generate Release +on: + workflow_run: + workflows: Build Project + types: completed + branches: master + +jobs: + create-release-suffix: + name: Create Release Name Suffix + if: github.event.workflow_run.conclusion == 'success' + runs-on: ubuntu-latest + outputs: + suffix: ${{ steps.form_suffix.outputs.suffix }} + steps: + - name: Checkout project + uses: actions/checkout@v4 + - name: Get target FP version + id: check_target_fp + env: + match_start: set\(TARGET_FP_VERSION_PREFIX + match_end: \) + shell: pwsh + run: | + $project_lists = Get-Content -Raw CMakeLists.txt + if(!($project_lists -match '(?<=${{ env.match_start }})(.*)(?=${{ env.match_end }})')){ + throw "Could not get target FP version!" + } + $target_version = "v$($Matches[1].Trim())" + echo "fp_version=$target_version" >> $Env:GITHUB_ENV + - name: Form suffix + id: form_suffix + run: | + suffix="(Targets FP $fp_version)" + echo "suffix=$suffix" >> $GITHUB_OUTPUT + + update-redirect: + name: Update redirect page + permissions: + actions: read + contents: read + pages: write + id-token: write + if: github.event.workflow_run.conclusion == 'success' + environment: + name: github-pages + url: ${{ steps.page-deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v4 + - name: Setup pages + uses: actions/configure-pages@v4 + - name: Upload pages artifact + uses: actions/upload-pages-artifact@v3 + with: + path: ${{ github.workspace }}/redirector + - name: Deploy pages artifact + id: page-deployment + uses: actions/deploy-pages@v4 + + generate-release: + name: Generate Release + needs: create-release-suffix + 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 }} + name_suffix: ${{ needs.create-release-suffix.outputs.suffix }} 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 e26b5db..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 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 fdcd799..0000000 --- a/.github/workflows/master-pull-request-merge-reaction.yml +++ /dev/null @@ -1,126 +0,0 @@ -name: Master pull-request merge reaction -on: - pull_request: - types: [closed] - branches: - - 'master' -env: - 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 }} - target_fp_version: ${{ steps.check_target_fp.outputs.fp_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: Checkout Project - id: proj-checkout - uses: oblivioncth/actions/git/smart-checkout@dev - - name: Get target FP version - id: check_target_fp - working-directory: ${{ steps.proj-checkout.outputs.path }} - env: - match_start: set\(TARGET_FP_VERSION_PREFIX - match_end: \) - run: | - $project_lists = Get-Content -Raw CMakeLists.txt - if(!($project_lists -match '(?<=${{ env.match_start }})(.*)(?=${{ env.match_end }})')){ - throw "Could not get target FP version!" - } - $target_version = "v$($Matches[1].Trim())" - echo "fp_version=$target_version" >> $Env:GITHUB_OUTPUT - - 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_clifp_release_windows: - name: Build CLIFp Release (Windows) - needs: tag_master_and_sync_dev - if: github.event.pull_request.merged == true - uses: ./.github/workflows/build-clifp-windows.yml - secrets: - qt_ffynnon_cred: ${{ secrets.OBYBOT_FFYNNON_CREDS }} - - build_clifp_release_linux: - name: Build CLIFp Release (Linux) - needs: tag_master_and_sync_dev - if: github.event.pull_request.merged == true - uses: ./.github/workflows/build-clifp-linux.yml - secrets: - qt_ffynnon_cred: ${{ secrets.OBYBOT_FFYNNON_CREDS }} - - update-redirect: - name: Update redirect page - 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: Checkout repo - uses: actions/checkout@v4 - - name: Setup pages - uses: actions/configure-pages@v4 - - name: Upload pages artifact - uses: actions/upload-pages-artifact@v3 - with: - path: ${{ github.workspace }}/redirector - - name: Deploy pages artifact - id: page-deployment - uses: actions/deploy-pages@v4 - - create-release: - name: Create GitHub release - needs: [build_clifp_release_windows, build_clifp_release_linux, tag_master_and_sync_dev] - if: github.event.pull_request.merged == true - runs-on: ubuntu-latest - steps: - - name: Download built CLIFp artifacts - uses: actions/download-artifact@v4 - 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: "CLIFp Release v${{ needs.tag_master_and_sync_dev.outputs.new_version }} (Targets FP ${{ needs.tag_master_and_sync_dev.outputs.target_fp_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 f039792..0000000 --- a/.github/workflows/push-reaction.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: CLIFp Push Reaction -on: - workflow_dispatch: - push: - branches-ignore: - - 'master' - -jobs: - trigger-windows-build: - name: Build CLIFp (Windows) - uses: ./.github/workflows/build-clifp-windows.yml - secrets: - qt_ffynnon_cred: ${{ secrets.OBYBOT_FFYNNON_CREDS }} - - trigger-linux-build: - name: Build CLIFp (Linux) - uses: ./.github/workflows/build-clifp-linux.yml - secrets: - qt_ffynnon_cred: ${{ secrets.OBYBOT_FFYNNON_CREDS }} \ 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