-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from oblivioncth/dev
Merge to master for v0.9.1
- Loading branch information
Showing
76 changed files
with
4,118 additions
and
1,690 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.