fix(ci): install cmake 3.30 via official binary instead of apt #63
This file contains hidden or 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
| name: Linux Static Qt6 | |
| on: | |
| # push代码时触发workflow | |
| push: | |
| # 忽略README.md | |
| paths-ignore: | |
| - "README.md" | |
| - "LICENSE" | |
| - "BUILD.md" | |
| # pull_request时触发workflow | |
| pull_request: | |
| # 忽略README.md | |
| paths-ignore: | |
| - "README.md" | |
| - "LICENSE" | |
| - "BUILD.md" | |
| release: | |
| types: [published] | |
| jobs: | |
| linux: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| build_type: [Release, RelWithDebInfo, Debug] | |
| name: Linux Static ${{ matrix.build_type }} | |
| runs-on: ubuntu-latest | |
| container: | |
| image: ubuntu:20.04 | |
| options: --privileged | |
| env: | |
| CCACHE_DIR: ${{ github.workspace }}/.ccache | |
| TZ: Asia/Shanghai | |
| DEBIAN_FRONTEND: noninteractive | |
| steps: | |
| - name: Get the version | |
| id: get_version | |
| shell: bash | |
| run: echo "VERSION=$(echo $GITHUB_REF | cut -d / -f 3)" >> $GITHUB_OUTPUT | |
| - name: Install Build Essentials | |
| run: | | |
| apt update | |
| apt install -y build-essential git perl ninja-build wget | |
| wget -q https://github.com/Kitware/CMake/releases/download/v3.30.6/cmake-3.30.6-linux-x86_64.tar.gz -O /tmp/cmake.tar.gz | |
| tar -xzf /tmp/cmake.tar.gz -C /opt | |
| echo "/opt/cmake-3.30.6-linux-x86_64/bin" >> $GITHUB_PATH | |
| - name: Checking out sources | |
| uses: actions/checkout@v6 | |
| with: | |
| submodules: "recursive" | |
| - name: Install build dependencies | |
| run: | | |
| apt update | |
| apt install -y build-essential ninja-build pkgconf bash | |
| apt install -y libgl1-mesa-dev libglu1-mesa-dev | |
| apt install -y libfontconfig1-dev libfreetype6-dev libx11-dev libx11-xcb-dev libxext-dev libxfixes-dev libxi-dev libxrender-dev libxcb1-dev libxcb-glx0-dev libxcb-keysyms1-dev libxcb-image0-dev libxcb-shm0-dev libxcb-icccm4-dev libxcb-sync0-dev libxcb-xfixes0-dev libxcb-shape0-dev libxcb-randr0-dev libxcb-render-util0-dev libxcb-xinerama0-dev libxkbcommon-dev libxkbcommon-x11-dev | |
| apt install -y libharfbuzz-dev libsm-dev libdrm-dev | |
| apt install -y '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev | |
| apt install -y bubblewrap | |
| - name: Install Qt | |
| run: | | |
| cd .. | |
| wget https://github.com/Project-LemonLime/qt5ci/releases/latest/download/qt-6.9-static-linux.tar.gz | |
| tar -zxvf qt-6.9-static-linux.tar.gz | |
| - name: Build | |
| run: | | |
| cd .. | |
| mkdir build | |
| cd build | |
| cmake ../Project_LemonLime -GNinja -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DLEMON_BUILD_INFO="Build for Linux" -DLEMON_BUILD_EXTRA_INFO="Build on $(uname -sr)" -DCMAKE_PREFIX_PATH=../qt6/bin | |
| cmake --build . --parallel $(nproc) | |
| - name: Run tests | |
| run: | | |
| ctest --test-dir ../build --output-on-failure --timeout 120 | |
| - name: Package | |
| run: | | |
| cd ../build | |
| cmake --build . --target package --parallel $(nproc) | |
| cd ../Project_LemonLime | |
| cp ../build/lemon ./ | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: LemonLime-linux-qt6-x86_64-${{ matrix.build_type }} | |
| path: lemon | |
| - name: Upload binaries to release | |
| uses: svenstaro/upload-release-action@v2 | |
| if: startsWith(github.event.ref, 'refs/tags/') | |
| with: | |
| repo_token: ${{ secrets.GITHUB_TOKEN }} | |
| file: lemon | |
| asset_name: LemonLime-linux-qt6-x86_64-${{ matrix.build_type }} | |
| tag: ${{ github.ref }} | |
| overwrite: true |