diff --git a/.github/workflows/build-project.yml b/.github/workflows/build-project.yml new file mode 100644 index 0000000..e240300 --- /dev/null +++ b/.github/workflows/build-project.yml @@ -0,0 +1,26 @@ +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 }} + with: + runs_exclude: > + [ + { "compiler": "g++-10" } + ] diff --git a/.github/workflows/build-qi-qmp-linux.yml b/.github/workflows/build-qi-qmp-linux.yml deleted file mode 100644 index 7d6a090..0000000 --- a/.github/workflows/build-qi-qmp-linux.yml +++ /dev/null @@ -1,113 +0,0 @@ -name: Linux - Build QI-QMP -on: - workflow_call: - secrets: - qt_ffynnon_cred: - description: 'Credentials for getting Qt from Ffynnon' - required: true -env: - qt_install_dir: ${{ github.workspace }}/Qt/Install - qi_qmp_src_suffix: QI-QMP/Source - qi_qmp_src_dir: ${{ github.workspace }}/QI-QMP/Source - qi_qmp_build_dir: ${{ github.workspace }}/QI-QMP/Build - -jobs: - build-qi-qmp: - name: Build QI-QMP - Linux (Release) - strategy: - fail-fast: false - matrix: - os: [ubuntu-20.04, ubuntu-22.04] - compiler: [clang] - lib_linkage: [shared, static] - include: - - os: ubuntu-20.04 - compiler: clang - c_comp: clang-12 - cxx_comp: clang++-12 - qt_comp: clang12 - - os: ubuntu-22.04 - compiler: gcc - c_comp: gcc-12 - cxx_comp: g++-12 - qt_comp: clang14 - lib_linkage: shared - - os: ubuntu-22.04 - compiler: gcc - c_comp: gcc-12 - cxx_comp: g++-12 - qt_comp: clang14 - lib_linkage: static - - os: ubuntu-22.04 - compiler: clang - c_comp: clang-14 - cxx_comp: clang++-14 - qt_comp: clang14 - - lib_linkage: shared - cmake_bsl: ON - - lib_linkage: static - cmake_bsl: OFF - 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 "qi_qmp_package_path=${{ env.qi_qmp_build_dir }}/out/dist" >> $GITHUB_ENV - qi_qmp_install_path="${{ env.qi_qmp_build_dir }}/out/install" - echo "qi_qmp_install_path=$qi_qmp_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.5.1 - os: linux - compiler: ${{ matrix.qt_comp }} - linkage: ${{ matrix.lib_linkage }} - path: ${{ env.qt_install_dir }} - credentials: ${{ secrets.qt_ffynnon_cred }} - - 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 Doxygen - uses: oblivioncth/actions/ubuntu/install-doxygen-from-sourceforge@dev - with: - version: 1.9.7 - - name: Install Graphviz - run: sudo apt-get install graphviz - - name: Install Ninja - run: sudo apt-get install ninja-build - - name: Install Harfbuzz - run: sudo apt-get install libharfbuzz-dev - - name: Checkout QI-QMP - uses: actions/checkout@v3 - with: - path: ${{ env.qi_qmp_src_suffix }} - fetch-depth: 0 # Required for verbose versioning to work correctly - - name: Build/Install QI-QMP - working-directory: ${{ env.qi_qmp_src_dir }} - run: | - echo Configuring CMake... - "$qt_cmake" -G "$cmake_gen" -S "$qi_qmp_src_dir" -B "$qi_qmp_build_dir" -D QI_QMP_DOCS=ON -D BUILD_SHARED_LIBS="${{ matrix.cmake_bsl }}" -D CMAKE_CXX_COMPILER="${{ matrix.cxx_comp }}" -D CMAKE_C_COMPILER="${{ matrix.c_comp }}" - echo Changing to build directory... - cd "$qi_qmp_build_dir" - echo Building QI-QMP Release/Docs... - cmake --build . --target all --config Release - echo Installing QI-QMP Release/Docs... - cmake --install . --config Release - echo Packaging QI-QMP... - cpack -C "Release" - echo Build complete. - - name: Get QI-QMP artifact name - id: get_artifact_name - run: | - cpack_name=$(find "${{ env.qi_qmp_package_path }}" -type f -name "*.zip") - artifact_name="$(basename "$cpack_name" .zip) [${{ matrix.cxx_comp }}]" - echo "current_artifact_name=$artifact_name" >> $GITHUB_ENV - - name: Upload QI-QMP build artifact - uses: actions/upload-artifact@v3 - with: - name: ${{ env.current_artifact_name }} - path: ${{ env.qi_qmp_install_path }} - if-no-files-found: error diff --git a/.github/workflows/build-qi-qmp-windows.yml b/.github/workflows/build-qi-qmp-windows.yml deleted file mode 100644 index ab556b3..0000000 --- a/.github/workflows/build-qi-qmp-windows.yml +++ /dev/null @@ -1,95 +0,0 @@ -name: Windows - Build QI-QMP -on: - workflow_call: - secrets: - qt_ffynnon_cred: - description: 'Credentials for getting Qt from Ffynnon' - required: true - outputs: - doc_artifact_name: - description: "Name of artifact used to update docs" - value: ${{ jobs.build-qi-qmp.outputs.doc_artifact_name }} -env: - qt_install_dir: ${{ github.workspace }}/Qt/Install - qi_qmp_src_suffix: QI-QMP/Source - qi_qmp_src_dir: ${{ github.workspace }}/QI-QMP/Source - qi_qmp_build_dir: ${{ github.workspace }}/QI-QMP/Build - -jobs: - build-qi-qmp: - name: Build QI-QMP - Windows (Release) - strategy: - fail-fast: false - matrix: - lib_linkage: [shared, static] - include: - - lib_linkage: shared - cmake_bsl: ON - - lib_linkage: static - cmake_bsl: OFF - 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 "qi_qmp_package_path=${{ env.qi_qmp_build_dir }}/out/dist" >> $Env:GITHUB_ENV - $qi_qmp_install_path="${{ env.qi_qmp_build_dir }}/out/install" - echo "qi_qmp_install_path=$qi_qmp_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.5.1 - os: windows - compiler: msvc2022 - linkage: ${{ matrix.lib_linkage }} - path: ${{ env.qt_install_dir }} - credentials: ${{ secrets.qt_ffynnon_cred }} - - name: Install Doxygen - uses: oblivioncth/actions/general/cache-and-install-doxygen-from-ffynnon@dev - with: - version: 1.9.7 - os: windows - credentials: ${{ secrets.qt_ffynnon_cred }} - - name: Install Graphviz - run: choco install graphviz - - name: Checkout QI-QMP - uses: actions/checkout@v3 - with: - path: ${{ env.qi_qmp_src_suffix }} - fetch-depth: 0 # Required for verbose versioning to work correctly - - name: Build/Install QI-QMP - working-directory: ${{ env.qi_qmp_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.qi_qmp_src_dir}}" -B "${{ env.qi_qmp_build_dir }}" -D QI_QMP_DOCS=ON -D BUILD_SHARED_LIBS=${{ matrix.cmake_bsl }} - echo "Changing to build directory..." - cd "%qi_qmp_build_dir%" - echo "Building QI-QMP Release/Docs..." - cmake --build . --target all --config Release - echo "Installing QI-QMP Release/Docs..." - cmake --install . --config Release - echo "Packaging QI-QMP..." - cpack -C "Release" - echo "Build complete." - - name: Get QI-QMP artifact name - run: | - $artifact_name=$((Get-ChildItem -Path "${{ env.qi_qmp_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 QI-QMP build artifact - uses: actions/upload-artifact@v3 - with: - name: ${{ env.current_artifact_name }} - path: ${{ env.qi_qmp_install_path }} - if-no-files-found: error 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 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 c68aa27..0000000 --- a/.github/workflows/master-pull-request-merge-reaction.yml +++ /dev/null @@ -1,117 +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: Checkout Project - id: proj-checkout - uses: oblivioncth/actions/git/smart-checkout@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_qi_qmp_release_windows: - name: Build QI-QMP Release (Windows) - needs: tag_master_and_sync_dev - if: github.event.pull_request.merged == true - uses: ./.github/workflows/build-qi-qmp-windows.yml - secrets: - qt_ffynnon_cred: ${{ secrets.OBYBOT_FFYNNON_CREDS }} - - build_qi_qmp_release_linux: - name: Build QI-QMP Release (Linux) - needs: tag_master_and_sync_dev - if: github.event.pull_request.merged == true - uses: ./.github/workflows/build-qi-qmp-linux.yml - secrets: - qt_ffynnon_cred: ${{ secrets.OBYBOT_FFYNNON_CREDS }} - - update-docs: - name: Update gh-pages - needs: [build_qi_qmp_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 shared QI-QMP artifact - uses: actions/download-artifact@v3 - with: - name: ${{ needs.build_qi_qmp_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@v1 - - create-release: - name: Create GitHub release - needs: [update-docs, build_qi_qmp_release_windows, build_qi_qmp_release_linux, tag_master_and_sync_dev] - if: github.event.pull_request.merged == true - runs-on: ubuntu-latest - steps: - - name: Download built QI-QMP 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@v1 - with: - name: "QI-QMP 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 a53e72d..0000000 --- a/.github/workflows/pull-request-labeler.yml +++ /dev/null @@ -1,12 +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 c69982b..0000000 --- a/.github/workflows/push-reaction.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: QI-QMP Push Reaction -on: - workflow_dispatch: - push: - branches-ignore: - - 'master' - -jobs: - trigger-windows-build: - name: Build QI-QMP (Windows) - uses: ./.github/workflows/build-qi-qmp-windows.yml - secrets: - qt_ffynnon_cred: ${{ secrets.OBYBOT_FFYNNON_CREDS }} - - trigger-linux-build: - name: Build QI-QMP (Linux) - uses: ./.github/workflows/build-qi-qmp-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