|
| 1 | +name: Build |
| 2 | + |
| 3 | +on: [push, pull_request] |
| 4 | +jobs: |
| 5 | + build: |
| 6 | + runs-on: ubuntu-latest |
| 7 | + container: |
| 8 | + image: ghcr.io/flutter-tizen/build-engine:latest |
| 9 | + credentials: |
| 10 | + username: ${{ github.repository_owner }} |
| 11 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 12 | + |
| 13 | + strategy: |
| 14 | + matrix: |
| 15 | + arch: [arm, arm64, x86] |
| 16 | + mode: [debug, release, profile] |
| 17 | + include: |
| 18 | + - arch: arm |
| 19 | + triple: arm-linux-gnueabi |
| 20 | + - arch: arm64 |
| 21 | + triple: aarch64-linux-gnu |
| 22 | + - arch: x86 |
| 23 | + triple: i686-linux-gnu |
| 24 | + exclude: |
| 25 | + - arch: x86 |
| 26 | + mode: release |
| 27 | + - arch: x86 |
| 28 | + mode: profile |
| 29 | + |
| 30 | + steps: |
| 31 | + - uses: actions/checkout@v4 |
| 32 | + with: |
| 33 | + path: flutter |
| 34 | + fetch-depth: 1 |
| 35 | + |
| 36 | + - uses: actions/cache@v4 |
| 37 | + with: |
| 38 | + path: /tizen_tools/sysroot |
| 39 | + key: sysroot |
| 40 | + |
| 41 | + - name: Install depot_tools |
| 42 | + run: | |
| 43 | + git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git |
| 44 | + echo "$PWD/depot_tools" >> $GITHUB_PATH |
| 45 | + export PATH="$PWD/depot_tools:$PATH" |
| 46 | + # Install ninja |
| 47 | + apt install ninja-build |
| 48 | +
|
| 49 | + - name: Run gclient sync |
| 50 | + run: | |
| 51 | + cd flutter |
| 52 | + gclient config --unmanaged https://github.com/flutter-tizen/flutter |
| 53 | + sed -i "s/'flutter'/'.'/g" ./.gclient |
| 54 | + gclient setdep --var=download_dart_sdk=False --var=download_android_deps=False --var=download_fuchsia_deps=False --deps-file=DEPS |
| 55 | + gclient sync -v --no-history --shallow |
| 56 | +
|
| 57 | + - name: Generate sysroot |
| 58 | + run: flutter/engine/src/flutter/ci/tizen/generate_sysroot.py --out /tizen_tools/sysroot |
| 59 | + |
| 60 | + - name: Build |
| 61 | + run: | |
| 62 | + cd flutter |
| 63 | + # Ignore unsupported linker option. |
| 64 | + sed -i "/-Wl,--undefined-version/d" engine/src/build/config/compiler/BUILD.gn |
| 65 | +
|
| 66 | + engine/src/flutter/tools/gn \ |
| 67 | + --target-os linux \ |
| 68 | + --linux-cpu ${{ matrix.arch }} \ |
| 69 | + --no-goma \ |
| 70 | + --target-toolchain /tizen_tools/toolchains \ |
| 71 | + --target-sysroot /tizen_tools/sysroot/${{ matrix.arch }} \ |
| 72 | + --target-triple ${{ matrix.triple }} \ |
| 73 | + --runtime-mode ${{ matrix.mode }} \ |
| 74 | + --enable-fontconfig \ |
| 75 | + --disable-desktop-embeddings \ |
| 76 | + --target-dir build |
| 77 | + cd engine/src |
| 78 | + ninja -C out/build flutter_engine_library |
| 79 | + cp -f flutter/third_party/icu/flutter/icudtl.dat out/build |
| 80 | +
|
| 81 | + - name: Build gen_snapshot |
| 82 | + if: ${{ matrix.mode != 'debug' }} |
| 83 | + run: | |
| 84 | + cd flutter |
| 85 | + ninja -C engine/src/out/build clang_x64/gen_snapshot |
| 86 | +
|
| 87 | + - uses: actions/upload-artifact@v4 |
| 88 | + with: |
| 89 | + name: tizen-${{ matrix.arch }}-${{ matrix.mode }} |
| 90 | + path: | |
| 91 | + flutter/engine/src/out/build/libflutter_engine.so |
| 92 | + flutter/engine/src/out/build/icudtl.dat |
| 93 | + if-no-files-found: error |
| 94 | + |
| 95 | + - uses: actions/upload-artifact@v4 |
| 96 | + if: ${{ github.event_name == 'push' }} |
| 97 | + with: |
| 98 | + name: tizen-${{ matrix.arch }}-${{ matrix.mode }}_symbols |
| 99 | + path: flutter/engine/src/out/build/so.unstripped/libflutter_engine.so |
| 100 | + if-no-files-found: error |
| 101 | + |
| 102 | + - uses: actions/upload-artifact@v4 |
| 103 | + if: ${{ matrix.mode != 'debug' }} |
| 104 | + with: |
| 105 | + name: tizen-${{ matrix.arch }}-${{ matrix.mode }}_linux-x64 |
| 106 | + path: flutter/engine/src/out/build/clang_x64/gen_snapshot |
| 107 | + if-no-files-found: error |
| 108 | + |
| 109 | + windows-build: |
| 110 | + runs-on: windows-latest |
| 111 | + |
| 112 | + strategy: |
| 113 | + matrix: |
| 114 | + arch: [arm, arm64] |
| 115 | + mode: [release, profile] |
| 116 | + |
| 117 | + steps: |
| 118 | + - name: Run git checkout |
| 119 | + run: | |
| 120 | + mkdir C:\workspace\flutter |
| 121 | + cd C:\workspace\flutter |
| 122 | + git config --global core.autocrlf true |
| 123 | + git init --quiet |
| 124 | + git remote add origin https://github.com/${{ github.repository }} |
| 125 | + git fetch --depth 1 origin ${{ github.sha }} |
| 126 | + git checkout FETCH_HEAD |
| 127 | +
|
| 128 | + - name: Environment setup |
| 129 | + run: | |
| 130 | + Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -Force |
| 131 | + echo "DEPOT_TOOLS_WIN_TOOLCHAIN=0" >> $Env:GITHUB_ENV |
| 132 | + echo "GYP_MSVS_OVERRIDE_PATH=C:\Program Files\Microsoft Visual Studio\2022\Enterprise" >> $Env:GITHUB_ENV |
| 133 | + echo "WINDOWSSDKDIR=C:\Program Files (x86)\Windows Kits\10" >> $Env:GITHUB_ENV |
| 134 | +
|
| 135 | + - name: Install depot_tools |
| 136 | + run: | |
| 137 | + Invoke-WebRequest -Uri https://storage.googleapis.com/chrome-infra/depot_tools.zip -OutFile depot_tools.zip |
| 138 | + 7z x -y -o"C:\workspace\depot_tools" .\depot_tools.zip |
| 139 | + echo "C:\workspace\depot_tools" >> $Env:GITHUB_PATH |
| 140 | +
|
| 141 | + - name: Run gclient sync |
| 142 | + working-directory: C:\workspace\flutter |
| 143 | + shell: powershell |
| 144 | + run: | |
| 145 | + gclient config --unmanaged https://github.com/flutter-tizen/flutter |
| 146 | + (Get-Content ".gclient") | ForEach-Object { $_ -replace "'flutter'","'.'" } | Set-Content ".gclient" |
| 147 | + # TODO(jsuya) : pipes deprecated in python 3.13. (https://dart-review.googlesource.com/c/sdk/+/307620) |
| 148 | + (Get-Content "engine/src/build/vs_toolchain.py") | ForEach-Object { $_ -replace 'import pipes','' } | Set-Content "engine/src/build/vs_toolchain.py" |
| 149 | + gclient setdep --var=download_dart_sdk=False --var=download_android_deps=False --var=download_fuchsia_deps=False --deps-file=DEPS |
| 150 | + gclient sync -v --no-history --shallow |
| 151 | +
|
| 152 | + - name: Build |
| 153 | + working-directory: C:\workspace\flutter\engine\src |
| 154 | + run: | |
| 155 | + python3 .\flutter\tools\gn ` |
| 156 | + --linux ` |
| 157 | + --linux-cpu=${{ matrix.arch }} ` |
| 158 | + --runtime-mode=${{ matrix.mode }} ` |
| 159 | + --no-goma ` |
| 160 | + --target-dir build |
| 161 | + # TODO(jsuya) : https://github.com/flutter/flutter/issues/163487 |
| 162 | + C:\workspace\flutter\engine\src\flutter/third_party/ninja/ninja -C .\out\build gen_snapshot |
| 163 | +
|
| 164 | + - uses: actions/upload-artifact@v4 |
| 165 | + with: |
| 166 | + name: tizen-${{ matrix.arch }}-${{ matrix.mode }}_windows-x64 |
| 167 | + path: C:\workspace\flutter\engine\src\out\build\gen_snapshot.exe |
| 168 | + if-no-files-found: error |
| 169 | + |
| 170 | + macos-build: |
| 171 | + runs-on: macos-latest |
| 172 | + |
| 173 | + strategy: |
| 174 | + matrix: |
| 175 | + arch: [arm, arm64] |
| 176 | + mode: [release, profile] |
| 177 | + |
| 178 | + steps: |
| 179 | + - uses: actions/checkout@v4 |
| 180 | + with: |
| 181 | + path: flutter |
| 182 | + fetch-depth: 1 |
| 183 | + |
| 184 | + - uses: actions/setup-python@v5 |
| 185 | + with: |
| 186 | + python-version: "3.11" |
| 187 | + |
| 188 | + - name: Install depot_tools |
| 189 | + run: | |
| 190 | + git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git |
| 191 | + echo "$PWD/depot_tools" >> $GITHUB_PATH |
| 192 | +
|
| 193 | + - name: Run gclient sync |
| 194 | + run: | |
| 195 | + cd flutter |
| 196 | + gclient config --unmanaged https://github.com/flutter-tizen/flutter |
| 197 | + sed -i '' "s/'flutter'/'.'/g" .gclient |
| 198 | + gclient setdep --var=download_dart_sdk=False --var=download_android_deps=False --var=download_fuchsia_deps=False --deps-file=DEPS |
| 199 | + gclient sync -v --no-history --shallow |
| 200 | +
|
| 201 | + - name: Build |
| 202 | + run: | |
| 203 | + cd flutter |
| 204 | + # Change host_toolchain to mac/clang_arm64. |
| 205 | + sed -i "" "s|//build/toolchain/linux:clang_$host_cpu|//build/toolchain/mac:clang_$host_cpu|g" engine/src/build/config/BUILDCONFIG.gn |
| 206 | +
|
| 207 | + # Pass dummy values to prevent using the default (Linux) toolchain. |
| 208 | + engine/src/flutter/tools/gn \ |
| 209 | + --linux \ |
| 210 | + --linux-cpu=${{ matrix.arch }} \ |
| 211 | + --no-goma \ |
| 212 | + --target-toolchain _ \ |
| 213 | + --target-sysroot _ \ |
| 214 | + --target-triple _ \ |
| 215 | + --runtime-mode=${{ matrix.mode }} \ |
| 216 | + --disable-desktop-embeddings \ |
| 217 | + --target-dir build |
| 218 | + cd engine/src |
| 219 | + # TODO(jsuya) : https://github.com/flutter/flutter/issues/163487 |
| 220 | + flutter/third_party/ninja/ninja -C out/build clang_arm64/gen_snapshot |
| 221 | +
|
| 222 | + - uses: actions/upload-artifact@v4 |
| 223 | + with: |
| 224 | + name: tizen-${{ matrix.arch }}-${{ matrix.mode }}_darwin-arm64 |
| 225 | + path: flutter/engine/src/out/build/clang_arm64/gen_snapshot |
| 226 | + if-no-files-found: error |
| 227 | + |
| 228 | + macos-intel-build: |
| 229 | + runs-on: macos-13 |
| 230 | + |
| 231 | + strategy: |
| 232 | + matrix: |
| 233 | + arch: [arm, arm64] |
| 234 | + mode: [release, profile] |
| 235 | + |
| 236 | + steps: |
| 237 | + - uses: actions/checkout@v4 |
| 238 | + with: |
| 239 | + path: flutter |
| 240 | + fetch-depth: 1 |
| 241 | + |
| 242 | + - uses: actions/setup-python@v5 |
| 243 | + with: |
| 244 | + python-version: "3.11" |
| 245 | + |
| 246 | + - name: Install depot_tools |
| 247 | + run: | |
| 248 | + git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git |
| 249 | + echo "$PWD/depot_tools" >> $GITHUB_PATH |
| 250 | +
|
| 251 | + - name: Run gclient sync |
| 252 | + run: | |
| 253 | + cd flutter |
| 254 | + gclient config --unmanaged https://github.com/flutter-tizen/flutter |
| 255 | + sed -i '' "s/'flutter'/'.'/g" .gclient |
| 256 | + gclient setdep --var=download_dart_sdk=False --var=download_android_deps=False --var=download_fuchsia_deps=False --deps-file=DEPS |
| 257 | + gclient sync -v --no-history --shallow |
| 258 | +
|
| 259 | + - name: Build |
| 260 | + run: | |
| 261 | + cd flutter |
| 262 | + # Change host_toolchain to mac/clang_x64. |
| 263 | + sed -i "" "s|//build/toolchain/linux:clang_$host_cpu|//build/toolchain/mac:clang_$host_cpu|g" engine/src/build/config/BUILDCONFIG.gn |
| 264 | +
|
| 265 | + # Pass dummy values to prevent using the default (Linux) toolchain. |
| 266 | + engine/src/flutter/tools/gn \ |
| 267 | + --linux \ |
| 268 | + --linux-cpu=${{ matrix.arch }} \ |
| 269 | + --no-goma \ |
| 270 | + --target-toolchain _ \ |
| 271 | + --target-sysroot _ \ |
| 272 | + --target-triple _ \ |
| 273 | + --runtime-mode=${{ matrix.mode }} \ |
| 274 | + --disable-desktop-embeddings \ |
| 275 | + --target-dir build |
| 276 | + cd engine/src |
| 277 | + # TODO(jsuya) : https://github.com/flutter/flutter/issues/163487 |
| 278 | + flutter/third_party/ninja/ninja -C out/build clang_x64/gen_snapshot |
| 279 | +
|
| 280 | + - uses: actions/upload-artifact@v4 |
| 281 | + with: |
| 282 | + name: tizen-${{ matrix.arch }}-${{ matrix.mode }}_darwin-x64 |
| 283 | + path: flutter/engine/src/out/build/clang_x64/gen_snapshot |
| 284 | + if-no-files-found: error |
| 285 | + |
| 286 | + release: |
| 287 | + needs: [build] |
| 288 | + if: ${{ github.event_name == 'push' }} |
| 289 | + runs-on: ubuntu-latest |
| 290 | + |
| 291 | + steps: |
| 292 | + - uses: actions/checkout@v4 |
| 293 | + |
| 294 | + - uses: actions/download-artifact@v4 |
| 295 | + |
| 296 | + - name: Create archives |
| 297 | + run: | |
| 298 | + for name in tizen-*; do |
| 299 | + 7z a $name.zip ./$name/* |
| 300 | + done |
| 301 | +
|
| 302 | + - name: Set variables |
| 303 | + run: | |
| 304 | + echo "SHORT_SHA=$(git rev-parse --short $GITHUB_SHA)" >> $GITHUB_ENV |
| 305 | + echo "VERSION=$(echo "${{ github.ref_name }}" | cut -d'-' -f2)" >> $GITHUB_ENV |
| 306 | +
|
| 307 | + - uses: softprops/action-gh-release@v2 |
| 308 | + with: |
| 309 | + name: ${{ env.VERSION }} (${{ env.SHORT_SHA }}) |
| 310 | + tag_name: ${{ env.SHORT_SHA }} |
| 311 | + target_commitish: ${{ github.sha }} |
| 312 | + files: tizen-*.zip |
| 313 | + body: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} |
0 commit comments