|
| 1 | +name: Linux riscv64 |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + srcrev: |
| 7 | + description: 'Flutter Engine Commit Hash' |
| 8 | + required: True |
| 9 | + default: '' |
| 10 | + release: |
| 11 | + description: 'Release' |
| 12 | + required: false |
| 13 | + default: 'false' |
| 14 | + |
| 15 | +jobs: |
| 16 | + linux-riscv64: |
| 17 | + runs-on: [self-hosted, linux, x64] |
| 18 | + env: |
| 19 | + arch: riscv64 |
| 20 | + linux_cpu: riscv64 |
| 21 | + target_triple: riscv64-unknown-linux-gnu |
| 22 | + target_sysroot: debian_trixie_riscv64-sysroot |
| 23 | + tag_debug: linux-engine-sdk-debug-riscv64-${{ inputs.srcrev }} |
| 24 | + tag_debug_unopt: linux-engine-sdk-debug-unopt-riscv64-${{ inputs.srcrev }} |
| 25 | + tag_release: linux-engine-sdk-release-riscv64-${{ inputs.srcrev }} |
| 26 | + tag_profile: linux-engine-sdk-profile-riscv64-${{ inputs.srcrev }} |
| 27 | + notes_debug: "Flutter Engine - runtime debug SDK" |
| 28 | + notes_debug_unopt: "Flutter Engine - runtime debug SDK" |
| 29 | + notes_release: "Flutter Engine - runtime release SDK" |
| 30 | + notes_profile: "Flutter Engine - runtime profile SDK" |
| 31 | + |
| 32 | + steps: |
| 33 | + - uses: actions/checkout@v4 |
| 34 | + with: |
| 35 | + persist-credentials: false |
| 36 | + |
| 37 | + - name: Install packages |
| 38 | + run: | |
| 39 | + git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git |
| 40 | +
|
| 41 | + - name: Get Flutter Source |
| 42 | + run: | |
| 43 | + export PATH=$PATH:$PWD/depot_tools |
| 44 | + export VPYTHON_VIRTUALENV_ROOT=$PWD/vpython |
| 45 | + git clone https://github.com/flutter/flutter.git |
| 46 | + pushd flutter |
| 47 | + gclient config --spec 'solutions=[{"managed":False,"name":".","url":"https://github.com/flutter/flutter.git","custom_deps":{},"custom_vars":{"download_android_deps":False,"download_windows_deps":False,"download_linux_deps":True},"deps_file":"DEPS","safesync_url":""}]' |
| 48 | + gclient sync --force --shallow --no-history -R -D --revision ${{ inputs.SRCREV }} -j$(nproc) -v |
| 49 | + popd |
| 50 | +
|
| 51 | + # fetch sysroot |
| 52 | + cd flutter/engine/src |
| 53 | + build/linux/sysroot_scripts/install-sysroot.py --arch=$arch |
| 54 | +
|
| 55 | + - name: Patch Flutter Source |
| 56 | + run: | |
| 57 | + PATCH_DIR=$PWD/patches |
| 58 | + cd flutter |
| 59 | + git apply $PATCH_DIR/0001-clang-toolchain.patch |
| 60 | + |
| 61 | + - name: Build Debug |
| 62 | + working-directory: flutter/engine/src |
| 63 | + run: | |
| 64 | + export PATH=$PATH:$PWD/../../../depot_tools |
| 65 | + export VPYTHON_VIRTUALENV_ROOT=$PWD/../../../vpython |
| 66 | + CLANG_ROOT=$(find -iname clang++) |
| 67 | + CLANG_ROOT=$(dirname $CLANG_ROOT) |
| 68 | + export CLANG_ROOT=$(dirname $CLANG_ROOT) |
| 69 | + ./flutter/tools/gn --runtime-mode=debug \ |
| 70 | + --embedder-for-target \ |
| 71 | + --no-build-embedder-examples \ |
| 72 | + --no-goma --no-rbe \ |
| 73 | + --no-stripped --no-enable-unittests \ |
| 74 | + --no-dart-version-git-info \ |
| 75 | + --linux-cpu $linux_cpu \ |
| 76 | + --target-os linux \ |
| 77 | + --target-sysroot $PWD/build/linux/$target_sysroot \ |
| 78 | + --target-toolchain $PWD/$CLANG_ROOT \ |
| 79 | + --target-triple $target_triple |
| 80 | + ninja -C out/linux_debug_$arch |
| 81 | +
|
| 82 | + - name: Prepare Debug Artifacts |
| 83 | + run: | |
| 84 | + scripts/prepare-sdk-$arch.sh flutter/engine/src/out/linux_debug_$arch $PWD/flutter/engine/src/build/linux/$target_sysroot |
| 85 | +
|
| 86 | + tar czfhv $tag_debug.tar.gz flutter/engine/src/out/linux_debug_$arch/engine-sdk/ |
| 87 | +
|
| 88 | + sha256sum -b $tag_debug.tar.gz > $tag_debug.tar.gz.sha256 |
| 89 | +
|
| 90 | + - name: Publish Debug |
| 91 | + if: ${{ inputs.release != 'true' }} |
| 92 | + uses: actions/upload-artifact@v4 |
| 93 | + with: |
| 94 | + name: engine-sdk-debug |
| 95 | + path: | |
| 96 | + linux-engine-sdk-debug-riscv64-${{ inputs.srcrev }}.tar.gz |
| 97 | + linux-engine-sdk-debug-riscv64-${{ inputs.srcrev }}.tar.gz.sha256 |
| 98 | +
|
| 99 | + - name: Release - Debug Release |
| 100 | + if: ${{ inputs.release == 'true' }} |
| 101 | + env: |
| 102 | + GH_TOKEN: ${{ github.token }} |
| 103 | + GH_REPO: ${{ github.repository }} |
| 104 | + run: | |
| 105 | + gh release delete "$tag_debug" --cleanup-tag -y |true |
| 106 | + gh release create --draft "$tag_debug" --title "$tag_debug" --notes "$notes_debug" |
| 107 | + gh release upload "$tag_debug" "$tag_debug.tar.gz" "$tag_debug.tar.gz.sha256" |
| 108 | + gh release edit "$tag_debug" --draft=false |
| 109 | +
|
| 110 | + - name: Build Debug Unoptimized |
| 111 | + working-directory: flutter/engine/src |
| 112 | + run: | |
| 113 | + export PATH=$PATH:$PWD/../../../depot_tools |
| 114 | + export VPYTHON_VIRTUALENV_ROOT=$PWD/../../../vpython |
| 115 | + CLANG_ROOT=$(find -iname clang++) |
| 116 | + CLANG_ROOT=$(dirname $CLANG_ROOT) |
| 117 | + export CLANG_ROOT=$(dirname $CLANG_ROOT) |
| 118 | + ./flutter/tools/gn --runtime-mode=debug \ |
| 119 | + --unoptimized \ |
| 120 | + --embedder-for-target \ |
| 121 | + --no-build-embedder-examples \ |
| 122 | + --no-goma --no-rbe \ |
| 123 | + --no-stripped --no-enable-unittests \ |
| 124 | + --no-dart-version-git-info \ |
| 125 | + --linux-cpu $linux_cpu \ |
| 126 | + --target-os linux \ |
| 127 | + --target-sysroot $PWD/build/linux/$target_sysroot \ |
| 128 | + --target-toolchain $PWD/$CLANG_ROOT \ |
| 129 | + --target-triple $target_triple |
| 130 | + ninja -C out/linux_debug_unopt_$arch |
| 131 | +
|
| 132 | + - name: Prepare Debug Unoptimized Artifacts |
| 133 | + run: | |
| 134 | + scripts/prepare-sdk-$arch.sh flutter/engine/src/out/linux_debug_unopt_$arch $PWD/flutter/engine/src/build/linux/$target_sysroot |
| 135 | +
|
| 136 | + tar czfhv $tag_debug_unopt.tar.gz flutter/engine/src/out/linux_debug_unopt_$arch/engine-sdk/ |
| 137 | +
|
| 138 | + sha256sum -b $tag_debug_unopt.tar.gz > $tag_debug_unopt.tar.gz.sha256 |
| 139 | +
|
| 140 | + - name: Publish Debug Unoptimized |
| 141 | + if: ${{ inputs.release != 'true' }} |
| 142 | + uses: actions/upload-artifact@v4 |
| 143 | + with: |
| 144 | + name: engine-sdk-debug-unoptimized |
| 145 | + path: | |
| 146 | + linux-engine-sdk-debug-unopt-riscv64-${{ inputs.srcrev }}.tar.gz |
| 147 | + linux-engine-sdk-debug-unopt-riscv64-${{ inputs.srcrev }}.tar.gz.sha256 |
| 148 | +
|
| 149 | + - name: Release - Debug Unoptimized Release |
| 150 | + if: ${{ inputs.release == 'true' }} |
| 151 | + env: |
| 152 | + GH_TOKEN: ${{ github.token }} |
| 153 | + GH_REPO: ${{ github.repository }} |
| 154 | + run: | |
| 155 | + gh release delete "$tag_debug_unopt" --cleanup-tag -y |true |
| 156 | + gh release create --draft "$tag_debug_unopt" --title "$tag_debug_unopt" --notes "$notes_debug_unopt" |
| 157 | + gh release upload "$tag_debug_unopt" "$tag_debug_unopt.tar.gz" "$tag_debug_unopt.tar.gz.sha256" |
| 158 | + gh release edit "$tag_debug_unopt" --draft=false |
| 159 | +
|
| 160 | + - name: Build Release |
| 161 | + working-directory: flutter/engine/src |
| 162 | + run: | |
| 163 | + export PATH=$PATH:$PWD/../../../depot_tools |
| 164 | + export VPYTHON_VIRTUALENV_ROOT=$PWD/../../../vpython |
| 165 | + CLANG_ROOT=$(find -iname clang++) |
| 166 | + CLANG_ROOT=$(dirname $CLANG_ROOT) |
| 167 | + export CLANG_ROOT=$(dirname $CLANG_ROOT) |
| 168 | + ./flutter/tools/gn --runtime-mode=release \ |
| 169 | + --embedder-for-target \ |
| 170 | + --no-build-embedder-examples \ |
| 171 | + --no-goma --no-rbe \ |
| 172 | + --no-stripped --no-enable-unittests \ |
| 173 | + --no-dart-version-git-info \ |
| 174 | + --linux-cpu $linux_cpu \ |
| 175 | + --target-os linux \ |
| 176 | + --target-sysroot $PWD/build/linux/$target_sysroot \ |
| 177 | + --target-toolchain $PWD/$CLANG_ROOT \ |
| 178 | + --target-triple $target_triple |
| 179 | + ninja -C out/linux_release_$arch |
| 180 | +
|
| 181 | + - name: Prepare Release Artifacts |
| 182 | + run: | |
| 183 | + scripts/prepare-sdk-$arch.sh flutter/engine/src/out/linux_release_$arch $PWD/flutter/engine/src/build/linux/$target_sysroot |
| 184 | +
|
| 185 | + tar czfhv $tag_release.tar.gz flutter/engine/src/out/linux_release_$arch/engine-sdk/ |
| 186 | +
|
| 187 | + sha256sum -b $tag_release.tar.gz > $tag_release.tar.gz.sha256 |
| 188 | +
|
| 189 | + - name: Publish Release |
| 190 | + if: ${{ inputs.release != 'true' }} |
| 191 | + uses: actions/upload-artifact@v4 |
| 192 | + with: |
| 193 | + name: engine-sdk-release |
| 194 | + path: | |
| 195 | + linux-engine-sdk-release-riscv64-${{ inputs.srcrev }}.tar.gz |
| 196 | + linux-engine-sdk-release-riscv64-${{ inputs.srcrev }}.tar.gz.sha256 |
| 197 | +
|
| 198 | + - name: Release - Publish Release |
| 199 | + if: ${{ inputs.release == 'true' }} |
| 200 | + env: |
| 201 | + GH_TOKEN: ${{ github.token }} |
| 202 | + GH_REPO: ${{ github.repository }} |
| 203 | + run: | |
| 204 | + gh release delete "$tag_release" --cleanup-tag -y |true |
| 205 | + gh release create --draft "$tag_release" --title "$tag_release" --notes "$notes_release" |
| 206 | + gh release upload "$tag_release" "$tag_release.tar.gz" "$tag_release.tar.gz.sha256" |
| 207 | + gh release edit "$tag_release" --draft=false |
| 208 | +
|
| 209 | + - name: Build Profile |
| 210 | + working-directory: flutter/engine/src |
| 211 | + run: | |
| 212 | + export PATH=$PATH:$PWD/../../../depot_tools |
| 213 | + export VPYTHON_VIRTUALENV_ROOT=$PWD/../../../vpython |
| 214 | + CLANG_ROOT=$(find -iname clang++) |
| 215 | + CLANG_ROOT=$(dirname $CLANG_ROOT) |
| 216 | + export CLANG_ROOT=$(dirname $CLANG_ROOT) |
| 217 | + ./flutter/tools/gn --runtime-mode=profile \ |
| 218 | + --embedder-for-target \ |
| 219 | + --no-build-embedder-examples \ |
| 220 | + --no-goma --no-rbe \ |
| 221 | + --no-stripped --no-enable-unittests \ |
| 222 | + --no-dart-version-git-info \ |
| 223 | + --linux-cpu $linux_cpu \ |
| 224 | + --target-os linux \ |
| 225 | + --target-sysroot $PWD/build/linux/$target_sysroot \ |
| 226 | + --target-toolchain $PWD/$CLANG_ROOT \ |
| 227 | + --target-triple $target_triple |
| 228 | + ninja -C out/linux_profile_$arch |
| 229 | +
|
| 230 | + - name: Prepare Profile Artifacts |
| 231 | + run: | |
| 232 | + scripts/prepare-sdk-$arch.sh flutter/engine/src/out/linux_profile_$arch $PWD/flutter/engine/src/build/linux/$target_sysroot |
| 233 | +
|
| 234 | + tar czfhv $tag_profile.tar.gz flutter/engine/src/out/linux_profile_$arch/engine-sdk/ |
| 235 | +
|
| 236 | + sha256sum -b $tag_profile.tar.gz > $tag_profile.tar.gz.sha256 |
| 237 | +
|
| 238 | + - name: Publish Profile |
| 239 | + if: ${{ inputs.release != 'true' }} |
| 240 | + uses: actions/upload-artifact@v4 |
| 241 | + with: |
| 242 | + name: engine-sdk-profile |
| 243 | + path: | |
| 244 | + linux-engine-sdk-profile-riscv64-${{ inputs.srcrev }}.tar.gz |
| 245 | + linux-engine-sdk-profile-riscv64-${{ inputs.srcrev }}.tar.gz.sha256 |
| 246 | +
|
| 247 | + - name: Release - Publish Profile |
| 248 | + if: ${{ inputs.release == 'true' }} |
| 249 | + env: |
| 250 | + GH_TOKEN: ${{ github.token }} |
| 251 | + GH_REPO: ${{ github.repository }} |
| 252 | + run: | |
| 253 | + gh release delete "$tag_profile" --cleanup-tag -y |true |
| 254 | + gh release create --draft "$tag_profile" --title "$tag_profile" --notes "$notes_profile" |
| 255 | + gh release upload "$tag_profile" "$tag_profile.tar.gz" "$tag_profile.tar.gz.sha256" |
| 256 | + gh release edit "$tag_profile" --draft=false |
0 commit comments