|
11 | 11 | - 'QtScrcpy/**' |
12 | 12 | - '!QtScrcpy/res/**' |
13 | 13 | - '.github/workflows/ubuntu.yml' |
| 14 | + - 'ci/linux/**' |
14 | 15 | jobs: |
15 | 16 | build: |
16 | 17 | name: Build |
17 | | - runs-on: ${{ matrix.os }} |
| 18 | + runs-on: ubuntu-22.04 |
| 19 | + container: |
| 20 | + image: ubuntu:20.04 |
| 21 | + options: --privileged |
18 | 22 | strategy: |
19 | 23 | matrix: |
20 | | - os: [ubuntu-22.04] |
21 | 24 | qt-ver: [5.15.2] |
22 | 25 | qt-arch-install: [gcc_64] |
23 | 26 | gcc-arch: [x64] |
24 | 27 | env: |
25 | 28 | target-name: QtScrcpy |
26 | | - qt-install-path: ${{ github.workspace }}/${{ matrix.qt-ver }} |
| 29 | + qt-install-path: ${{ github.workspace }}/Qt/${{ matrix.qt-ver }} |
27 | 30 | plantform-des: ubuntu |
| 31 | + DEBIAN_FRONTEND: noninteractive |
28 | 32 | steps: |
29 | | - - name: Install Qt |
30 | | - |
31 | | - with: |
32 | | - version: ${{ matrix.qt-ver }} |
33 | | - cached: ${{ steps.cache-qt.outputs.cache-hit }} |
34 | | - - name: Cache Qt |
35 | | - id: cache-qt |
36 | | - uses: actions/cache@v4 |
37 | | - with: |
38 | | - path: ${{ env.qt-install-path }}/${{ matrix.qt-arch-install }} |
39 | | - key: ${{ runner.os }}/${{ matrix.qt-ver }}/${{ matrix.qt-arch-install }} |
40 | | - - name: Install GL library |
41 | | - run: sudo apt-get install -y libglew-dev libglfw3-dev |
| 33 | + - name: Install Git and basic dependencies |
| 34 | + run: | |
| 35 | + apt-get update |
| 36 | + apt-get install -y git ca-certificates sudo |
42 | 37 | - uses: actions/checkout@v2 |
43 | 38 | with: |
44 | 39 | fetch-depth: 0 |
45 | 40 | submodules: 'true' |
46 | 41 | ssh-key: ${{ secrets.BOT_SSH_KEY }} |
47 | | - - name: Build RelWithDebInfo |
48 | | - env: |
49 | | - ENV_QT_PATH: ${{ env.qt-install-path }} |
| 42 | + - name: Install system dependencies |
50 | 43 | run: | |
51 | | - ci/linux/build_for_linux.sh "RelWithDebInfo" |
52 | | - - name: Upload RelWithDebInfo |
53 | | - uses: actions/upload-artifact@v4 |
| 44 | + apt-get update |
| 45 | + apt-get install -y \ |
| 46 | + build-essential \ |
| 47 | + cmake \ |
| 48 | + libglew-dev \ |
| 49 | + libglfw3-dev \ |
| 50 | + imagemagick \ |
| 51 | + wget \ |
| 52 | + patchelf \ |
| 53 | + zip \ |
| 54 | + libxcb1-dev \ |
| 55 | + libxkbcommon-dev \ |
| 56 | + libxkbcommon-x11-dev \ |
| 57 | + libx11-dev \ |
| 58 | + libx11-xcb-dev \ |
| 59 | + libfontconfig1-dev \ |
| 60 | + libfreetype6-dev \ |
| 61 | + libxrender-dev \ |
| 62 | + libxext-dev \ |
| 63 | + gnupg \ |
| 64 | + lsb-release \ |
| 65 | + python3 \ |
| 66 | + python3-pip \ |
| 67 | + fuse \ |
| 68 | + libasound2-dev |
| 69 | + - name: Setup FUSE |
| 70 | + run: | |
| 71 | + apt-get install -y fuse |
| 72 | + if [ ! -e /dev/fuse ]; then |
| 73 | + mknod /dev/fuse c 10 229 || true |
| 74 | + chmod 666 /dev/fuse || true |
| 75 | + fi |
| 76 | + export APPIMAGE_EXTRACT_AND_RUN=1 |
| 77 | + - name: Install CMake 3.19+ |
| 78 | + run: | |
| 79 | + apt-get install -y software-properties-common |
| 80 | + apt-get update |
| 81 | + apt-get install -y cmake=3.19.* || { |
| 82 | + wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | apt-key add - |
| 83 | + apt-add-repository 'deb https://apt.kitware.com/ubuntu/ focal main' |
| 84 | + apt-get update |
| 85 | + apt-get install -y cmake |
| 86 | + } |
| 87 | + - name: Cache Qt |
| 88 | + id: cache-qt |
| 89 | + uses: actions/cache@v4 |
54 | 90 | with: |
55 | | - name: QtScrcpy-${{ matrix.os }}-${{ matrix.qt-arch-install }}-RelWithDebInfo |
56 | | - path: output/x64/RelWithDebInfo/* |
| 91 | + path: ${{ env.qt-install-path }}/${{ matrix.qt-arch-install }} |
| 92 | + key: ubuntu-20.04/${{ matrix.qt-ver }}/${{ matrix.qt-arch-install }} |
| 93 | + - name: Install Qt |
| 94 | + |
| 95 | + with: |
| 96 | + version: ${{ matrix.qt-ver }} |
| 97 | + cache: ${{ steps.cache-qt.outputs.cache-hit }} |
| 98 | + setup-python: false |
57 | 99 | - name: Build Release |
| 100 | + shell: bash |
58 | 101 | env: |
59 | | - ENV_QT_PATH: ${{ env.qt-install-path }} |
| 102 | + ENV_QT_PATH: ${{ github.workspace }}/Qt/${{ matrix.qt-ver }} |
60 | 103 | run: | |
61 | 104 | ci/linux/build_for_linux.sh "Release" |
62 | | - - name: Upload Release |
| 105 | + - name: Package AppImage |
| 106 | + shell: bash |
| 107 | + env: |
| 108 | + ENV_QT_PATH: ${{ github.workspace }}/Qt/${{ matrix.qt-ver }} |
| 109 | + run: | |
| 110 | + chmod +x ci/linux/package_appimage.sh |
| 111 | + ci/linux/package_appimage.sh "Release" |
| 112 | + - name: Upload AppImage Artifact |
63 | 113 | uses: actions/upload-artifact@v4 |
64 | 114 | with: |
65 | | - name: QtScrcpy-${{ matrix.os }}-${{ matrix.qt-arch-install }}-Release |
66 | | - path: output/x64/Release/* |
67 | | - - name: Install the zip utility |
68 | | - run: | |
69 | | - sudo apt install zip -y |
70 | | - - name: Zip the Artifacts |
| 115 | + name: QtScrcpy-ubuntu-20.04-${{ matrix.qt-arch-install }}-AppImage |
| 116 | + path: output/appimage/*.AppImage |
| 117 | + if-no-files-found: error |
| 118 | + - name: Prepare AppImage for Release |
| 119 | + if: startsWith(github.ref, 'refs/tags/') |
71 | 120 | run: | |
72 | | - zip -r QtScrcpy-${{ matrix.os }}-${{ matrix.qt-arch-install }}.zip output/x64/Release |
73 | | - - name: Upload to Releases |
| 121 | + APPIMAGE_FILE=$(find output/appimage -name "QtScrcpy-*.AppImage" -type f | head -n 1) |
| 122 | + if [ -z "$APPIMAGE_FILE" ] || [ ! -f "$APPIMAGE_FILE" ]; then |
| 123 | + echo "Error: AppImage file not found" |
| 124 | + exit 1 |
| 125 | + fi |
| 126 | + FINAL_NAME="QtScrcpy-ubuntu-20.04-${{ matrix.qt-arch-install }}.AppImage" |
| 127 | + cp "$APPIMAGE_FILE" "$FINAL_NAME" |
| 128 | + - name: Upload AppImage to Releases |
74 | 129 | if: startsWith(github.ref, 'refs/tags/') |
75 | 130 | |
76 | 131 | with: |
77 | | - file: QtScrcpy-${{ matrix.os }}-${{ matrix.qt-arch-install }}.zip |
78 | | - asset_name: QtScrcpy-${{ matrix.os }}-${{ matrix.qt-arch-install }}.zip |
| 132 | + file: QtScrcpy-ubuntu-20.04-${{ matrix.qt-arch-install }}.AppImage |
| 133 | + asset_name: QtScrcpy-ubuntu-20.04-${{ matrix.qt-arch-install }}.AppImage |
79 | 134 | repo_token: ${{ secrets.GITHUB_TOKEN }} |
80 | 135 | tag: ${{ github.ref }} |
81 | 136 | overwrite: true |
0 commit comments