Skip to content

Commit

Permalink
Merge pull request #20 from oblivioncth/dev
Browse files Browse the repository at this point in the history
Merge to master for v0.9.1
  • Loading branch information
oblivioncth authored Sep 30, 2022
2 parents 48fb0d7 + ddb084a commit 2799453
Show file tree
Hide file tree
Showing 76 changed files with 4,118 additions and 1,690 deletions.
3 changes: 3 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ changelog:
- title: Bug Fixes
labels:
- bug
- title: Backend Improvements
labels:
- backend
- title: Other Changes
labels:
- "*"
124 changes: 124 additions & 0 deletions .github/workflows/build-clifp-linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
name: Build CLIFp - Linux
on:
workflow_call:
secrets:
qt_static_url:
description: 'MEGA Qt static install archive URL'
required: true
outputs:
qt_static_artifact_name:
description: "CLIFp (Qt static) build artifact"
value: ${{ jobs.build-clifp.outputs.qt_static_artifact_name }}
env:
general_download_dir: ${{ github.workspace }}/Download
qt_install_dir: ${{ github.workspace }}/Qt/Install
qt_download_dir: ${{ github.workspace }}/Qt/Download
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:
matrix:
qt_linkage: [static]
runs-on: ubuntu-20.04
env:
c_comp: clang-12
cxx_comp: clang++-12
cmake_gen: Ninja Multi-Config
outputs:
qt_static_artifact_name: ${{ steps.get_artifact_name.outputs.qt_static_artifact_name }}
steps:
- name: Set matrix derived variables
uses: kanga333/variable-mapper@v0.2.2
with:
key: ${{ matrix.qt_linkage }}
map: |
{
"static": {
"qt_install_url": "${{ secrets.qt_static_url }}",
"artifact_output_var": "qt_static_artifact_name"
}
}
export_to: env,log
- 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: Cache Qt Build
id: cache-qt
uses: actions/cache@v3
with:
path: ${{ env.qt_install_dir }}
key: ${{ env.qt_install_url }}
- name: Install megatools
if: steps.cache-qt.outputs.cache-hit != 'true'
env:
mt_build: megatools-1.11.0.20220519-linux-x86_64
mt_arch_ext: tar.gz
mt_repo: https://megatools.megous.com/builds/builds/
run: |
curl "$mt_repo/$mt_build.$mt_arch_ext" --output "$general_download_dir/$mt_build.$mt_arch_ext" --create-dirs --location --silent --show-error
cd $general_download_dir
tar xf "$mt_build.$mt_arch_ext"
cd "$mt_build"
cp -p megatools /usr/local/bin
- name: Create Qt Download Directory
if: steps.cache-qt.outputs.cache-hit != 'true'
run: mkdir -p "${{ env.qt_download_dir }}"
- name: Download Qt Install
if: steps.cache-qt.outputs.cache-hit != 'true'
run: megatools dl "$qt_install_url" --path "${{ env.qt_download_dir }}"
- name: Determine Qt Install Package Name
if: steps.cache-qt.outputs.cache-hit != 'true'
run: |
qt_install_name=$(ls "${{ env.qt_download_dir }}" | grep "qt-.*7z")
echo "qt_install_dest=${{ env.qt_download_dir }}/$qt_install_name" >> $GITHUB_ENV
- name: Extract Qt Install
if: steps.cache-qt.outputs.cache-hit != 'true'
run: 7z x ${{ env.qt_install_dest }} -o${{ env.qt_install_dir }}
- 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: Checkout CLIFp
uses: actions/checkout@v3
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 CMAKE_CXX_COMPILER="$cxx_comp" -D CMAKE_C_COMPILER="$c_comp"
echo Changing to build directory...
cd "$clifp_build_dir"
echo Building CLIFp Release...
cmake --build . --target all --config Release
echo Installing CLIFp Release
cmake --build . --target install --config Release
echo Packaging CLIFp...
cpack -C "Debug;Release"
echo Build complete.
- name: Get CLIFp artifact name
id: get_artifact_name
run: |
cpack_name=$(find * -type f -name "*.zip")
artifact_name=$(basename "$cpack_name" .zip)
echo "::set-output name=${{ env.artifact_output_var }}::$artifact_name"
- name: Upload CLIFp build artifact
uses: actions/upload-artifact@v3
with:
name: ${{ steps.get_artifact_name.outputs[env.artifact_output_var] }}
path: ${{ env.clifp_install_path }}
if-no-files-found: error
20 changes: 11 additions & 9 deletions .github/workflows/build-clifp-windows.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Build CLIFp - Windows (Qt 6.3.1)
name: Build CLIFp - Windows
on:
workflow_call:
secrets:
qt_static_dec_key:
description: 'MEGA decryption key for Qt static install archive URL'
qt_static_url:
description: 'MEGA Qt static install archive URL'
required: true
outputs:
qt_static_artifact_name:
Expand Down Expand Up @@ -36,16 +36,13 @@ jobs:
map: |
{
"static": {
"qt_install_name": "qt-Production-6.3.1-win32-msvc-x64-static-release.7z",
"qt_install_url": "https://mega.nz/file/QupBFJrC",
"qt_install_url_key": "${{ secrets.qt_static_dec_key }}",
"qt_install_url": "${{ secrets.qt_static_url }}",
"artifact_output_var": "qt_static_artifact_name"
}
}
export_to: env,log
- name: Set derived variables with shell because GitHub Actions env context sucks
run: |
echo "qt_install_dest=${{ env.qt_download_dir }}/${{ env.qt_install_name }}" >> $Env:GITHUB_ENV
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
Expand All @@ -55,7 +52,7 @@ jobs:
uses: actions/cache@v3
with:
path: ${{ env.qt_install_dir }}
key: ${{ env.qt_install_name }}
key: ${{ env.qt_install_url }}
- name: Install megatools
if: steps.cache-qt.outputs.cache-hit != 'true'
run: choco install megatools
Expand All @@ -64,7 +61,12 @@ jobs:
run: New-Item -Path "${{ env.qt_download_dir }}" -ItemType "directory"
- name: Download Qt Install
if: steps.cache-qt.outputs.cache-hit != 'true'
run: megatools dl "${Env:qt_install_url}#${Env:qt_install_url_key}" --path "${{ env.qt_download_dir }}"
run: megatools dl "${Env:qt_install_url}" --path "${{ env.qt_download_dir }}"
- name: Determine Qt Install Package Name
if: steps.cache-qt.outputs.cache-hit != 'true'
run: |
$qt_install_name=(Get-ChildItem -Path "${{ env.qt_download_dir }}" -Name -Filter qt-*.7z)
echo "qt_install_dest=${{ env.qt_download_dir }}/${qt_install_name}" >> $Env:GITHUB_ENV
- name: Extract Qt Install
if: steps.cache-qt.outputs.cache-hit != 'true'
run: 7z x ${{ env.qt_install_dest }} -o${{ env.qt_install_dir }}
Expand Down
21 changes: 19 additions & 2 deletions .github/workflows/master-pull-request-merge-reaction.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ env:
ci_bot_username: ObyBotCI
ci_bot_email: 104651589+ObyBotCI@users.noreply.github.com
clifp_qts_win_artifact_path: ${{ github.workspace }}/CLIFpQtSWin
clifp_qts_linux_artifact_path: ${{ github.workspace }}/CLIFpQtSLinux

jobs:
tag_master_and_sync_dev:
Expand Down Expand Up @@ -78,25 +79,40 @@ jobs:
if: github.event.pull_request.merged == true
uses: ./.github/workflows/build-clifp-windows.yml
secrets:
qt_static_dec_key: ${{ secrets.QT_WINDOWS_STATIC_DECRYPT_KEY }}
qt_static_url: ${{ secrets.QT_WINDOWS_STATIC_URL }}

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_static_url: ${{ secrets.QT_LINUX_STATIC_URL }}

create-release:
name: Create GitHub release
needs: [build_clifp_release_windows, tag_master_and_sync_dev]
needs: [build_clifp_release_windows, build_clifp_release_linux, tag_master_and_sync_dev]
if: github.event.pull_request.merged == true
runs-on: windows-latest
steps:
- name: Set release artifact names
run: |
echo "release_qts_win_package_name=${{ needs.build_clifp_release_windows.outputs.qt_static_artifact_name }}" >> $Env:GITHUB_ENV
echo "release_qts_linux_package_name=${{ needs.build_clifp_release_linux.outputs.qt_static_artifact_name }}" >> $Env:GITHUB_ENV
- name: Download built static CLIFp artifact (Windows)
uses: actions/download-artifact@v3
with:
name: ${{ env.release_qts_win_package_name }}
path: ${{ env.clifp_qts_win_artifact_path }}
- name: Download built static CLIFp artifact (Linux)
uses: actions/download-artifact@v3
with:
name: ${{ env.release_qts_linux_package_name }}
path: ${{ env.clifp_qts_linux_artifact_path }}
- name: Zip up release artifacts
run: |
7z a "${{ env.release_qts_win_package_name }}.zip" "${{ env.clifp_qts_win_artifact_path }}/*"
7z a "${{ env.release_qts_linux_package_name }}.zip" "${{ env.clifp_qts_linux_artifact_path }}/*"
- name: Generate release
uses: softprops/action-gh-release@v1
with:
Expand All @@ -106,5 +122,6 @@ jobs:
generate_release_notes: true
files: |
${{ env.release_qts_win_package_name }}.zip
${{ env.release_qts_linux_package_name }}.zip

5 changes: 5 additions & 0 deletions .github/workflows/pull-request-labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,9 @@ jobs:
uses: actions-ecosystem/action-add-labels@v1
with:
labels: enhancement
- name: Label backend PR
if: startsWith(github.head_ref, 'backend/')
uses: actions-ecosystem/action-add-labels@v1
with:
labels: backend

8 changes: 7 additions & 1 deletion .github/workflows/push-reaction.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,10 @@ jobs:
name: Build CLIFp (Windows)
uses: ./.github/workflows/build-clifp-windows.yml
secrets:
qt_static_dec_key: ${{ secrets.QT_WINDOWS_STATIC_DECRYPT_KEY }}
qt_static_url: ${{ secrets.QT_WINDOWS_STATIC_URL }}

trigger-linux-build:
name: Build CLIFp (Linux)
uses: ./.github/workflows/build-clifp-linux.yml
secrets:
qt_static_url: ${{ secrets.QT_LINUX_STATIC_URL }}
Loading

0 comments on commit 2799453

Please sign in to comment.