|
| 1 | +name: Build |
| 2 | + |
| 3 | +on: [push, pull_request] |
| 4 | + |
| 5 | +jobs: |
| 6 | + build: |
| 7 | + runs-on: ubuntu-latest |
| 8 | + container: |
| 9 | + image: ghcr.io/flutter-tizen/build-engine:latest |
| 10 | + credentials: |
| 11 | + username: ${{ github.repository_owner }} |
| 12 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 13 | + |
| 14 | + strategy: |
| 15 | + matrix: |
| 16 | + arch: [arm, arm64, x86] |
| 17 | + mode: [debug, release, profile] |
| 18 | + include: |
| 19 | + - arch: arm |
| 20 | + triple: arm-linux-gnueabi |
| 21 | + - arch: arm64 |
| 22 | + triple: aarch64-linux-gnu |
| 23 | + - arch: x86 |
| 24 | + triple: i686-linux-gnu |
| 25 | + exclude: |
| 26 | + - arch: x86 |
| 27 | + mode: release |
| 28 | + - arch: x86 |
| 29 | + mode: profile |
| 30 | + |
| 31 | + steps: |
| 32 | + - uses: actions/checkout@v3 |
| 33 | + with: |
| 34 | + path: src/flutter |
| 35 | + fetch-depth: 0 |
| 36 | + |
| 37 | + - uses: actions/cache@v3 |
| 38 | + with: |
| 39 | + path: /tizen_tools/sysroot |
| 40 | + key: sysroot |
| 41 | + |
| 42 | + - name: Install depot_tools |
| 43 | + run: | |
| 44 | + git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git |
| 45 | + echo "$PWD/depot_tools" >> $GITHUB_PATH |
| 46 | +
|
| 47 | + - name: Run gclient sync |
| 48 | + run: | |
| 49 | + gclient config --name=src/flutter --unmanaged https://github.com/flutter-tizen/engine |
| 50 | + gclient setdep --var=download_dart_sdk=False --var=download_android_deps=False --deps-file=src/flutter/DEPS |
| 51 | + gclient sync -v --no-history --shallow |
| 52 | +
|
| 53 | + - name: Generate sysroot |
| 54 | + run: src/flutter/ci/tizen/generate_sysroot.py --out /tizen_tools/sysroot |
| 55 | + |
| 56 | + - name: Build |
| 57 | + run: | |
| 58 | + src/flutter/tools/gn \ |
| 59 | + --target-os linux \ |
| 60 | + --linux-cpu ${{ matrix.arch }} \ |
| 61 | + --no-goma \ |
| 62 | + --target-toolchain /tizen_tools/toolchains \ |
| 63 | + --target-sysroot /tizen_tools/sysroot/${{ matrix.arch }} \ |
| 64 | + --target-triple ${{ matrix.triple }} \ |
| 65 | + --runtime-mode ${{ matrix.mode }} \ |
| 66 | + --enable-fontconfig \ |
| 67 | + --disable-desktop-embeddings \ |
| 68 | + --target-dir build |
| 69 | + ninja -C src/out/build flutter_engine_library |
| 70 | + cp -f src/third_party/icu/flutter/icudtl.dat src/out/build |
| 71 | +
|
| 72 | + - name: Build gen_snapshot |
| 73 | + if: ${{ matrix.mode != 'debug' }} |
| 74 | + run: ninja -C src/out/build clang_x64/gen_snapshot |
| 75 | + |
| 76 | + - uses: actions/upload-artifact@v3 |
| 77 | + with: |
| 78 | + name: tizen-${{ matrix.arch }}-${{ matrix.mode }} |
| 79 | + path: | |
| 80 | + src/out/build/libflutter_engine.so |
| 81 | + src/out/build/icudtl.dat |
| 82 | + if-no-files-found: error |
| 83 | + |
| 84 | + - uses: actions/upload-artifact@v3 |
| 85 | + if: ${{ github.event_name == 'push' }} |
| 86 | + with: |
| 87 | + name: tizen-${{ matrix.arch }}-${{ matrix.mode }}_symbols |
| 88 | + path: src/out/build/so.unstripped/libflutter_engine.so |
| 89 | + if-no-files-found: error |
| 90 | + |
| 91 | + - uses: actions/upload-artifact@v3 |
| 92 | + if: ${{ matrix.mode != 'debug' }} |
| 93 | + with: |
| 94 | + name: tizen-${{ matrix.arch }}-${{ matrix.mode }}_linux-x64 |
| 95 | + path: src/out/build/clang_x64/gen_snapshot |
| 96 | + if-no-files-found: error |
| 97 | + |
| 98 | + windows-build: |
| 99 | + runs-on: windows-2019 |
| 100 | + |
| 101 | + strategy: |
| 102 | + matrix: |
| 103 | + arch: [arm, arm64] |
| 104 | + mode: [release, profile] |
| 105 | + |
| 106 | + steps: |
| 107 | + - name: Run git checkout |
| 108 | + run: | |
| 109 | + mkdir C:\workspace\engine\src\flutter |
| 110 | + cd C:\workspace\engine\src\flutter |
| 111 | + git config --global core.autocrlf true |
| 112 | + git init --quiet |
| 113 | + git remote add origin https://github.com/${{ github.repository }} |
| 114 | + git fetch --depth 1 origin ${{ github.sha }} |
| 115 | + git checkout FETCH_HEAD |
| 116 | +
|
| 117 | + - name: Environment setup |
| 118 | + run: | |
| 119 | + Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -Force |
| 120 | + echo "DEPOT_TOOLS_WIN_TOOLCHAIN=0" >> $Env:GITHUB_ENV |
| 121 | + echo "GYP_MSVS_OVERRIDE_PATH=C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise" >> $Env:GITHUB_ENV |
| 122 | + echo "WINDOWSSDKDIR=C:\Program Files (x86)\Windows Kits\10" >> $Env:GITHUB_ENV |
| 123 | +
|
| 124 | + - name: Install depot_tools |
| 125 | + run: | |
| 126 | + Invoke-WebRequest -Uri https://storage.googleapis.com/chrome-infra/depot_tools.zip -OutFile depot_tools.zip |
| 127 | + 7z x -y -o"C:\workspace\depot_tools" .\depot_tools.zip |
| 128 | + echo "C:\workspace\depot_tools" >> $Env:GITHUB_PATH |
| 129 | +
|
| 130 | + - name: Run gclient sync |
| 131 | + working-directory: C:\workspace\engine |
| 132 | + run: | |
| 133 | + gclient config --name=src\flutter --unmanaged https://github.com/flutter-tizen/engine |
| 134 | + gclient setdep --var=download_dart_sdk=False --deps-file=src/flutter/DEPS |
| 135 | + gclient sync -v --no-history --shallow |
| 136 | +
|
| 137 | + - name: Build |
| 138 | + working-directory: C:\workspace\engine\src |
| 139 | + run: | |
| 140 | + python3 .\flutter\tools\gn ` |
| 141 | + --linux ` |
| 142 | + --linux-cpu=${{ matrix.arch }} ` |
| 143 | + --runtime-mode=${{ matrix.mode }} ` |
| 144 | + --no-goma ` |
| 145 | + --target-dir build |
| 146 | + ninja -C .\out\build gen_snapshot |
| 147 | +
|
| 148 | + - uses: actions/upload-artifact@v3 |
| 149 | + with: |
| 150 | + name: tizen-${{ matrix.arch }}-${{ matrix.mode }}_windows-x64 |
| 151 | + path: C:\workspace\engine\src\out\build\gen_snapshot.exe |
| 152 | + if-no-files-found: error |
| 153 | + |
| 154 | + macos-build: |
| 155 | + runs-on: macos-11 |
| 156 | + |
| 157 | + strategy: |
| 158 | + matrix: |
| 159 | + arch: [arm, arm64] |
| 160 | + mode: [release, profile] |
| 161 | + |
| 162 | + steps: |
| 163 | + - uses: actions/checkout@v3 |
| 164 | + with: |
| 165 | + path: src/flutter |
| 166 | + fetch-depth: 0 |
| 167 | + |
| 168 | + - name: Install depot_tools |
| 169 | + run: | |
| 170 | + git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git |
| 171 | + echo "$PWD/depot_tools" >> $GITHUB_PATH |
| 172 | +
|
| 173 | + - name: Run gclient sync |
| 174 | + run: | |
| 175 | + gclient config --name=src/flutter --unmanaged https://github.com/flutter-tizen/engine |
| 176 | + gclient setdep --var=download_dart_sdk=False --var=download_android_deps=False --deps-file=src/flutter/DEPS |
| 177 | + gclient sync -v --no-history --shallow |
| 178 | +
|
| 179 | + - name: Build |
| 180 | + run: | |
| 181 | + # Change host_toolchain to mac/clang_x64. |
| 182 | + sed -i "" "s|//build/toolchain/linux:clang_$host_cpu|//build/toolchain/mac:clang_$host_cpu|g" src/build/config/BUILDCONFIG.gn |
| 183 | +
|
| 184 | + # Pass dummy values to prevent using the default (Linux) toolchain. |
| 185 | + src/flutter/tools/gn \ |
| 186 | + --linux \ |
| 187 | + --linux-cpu=${{ matrix.arch }} \ |
| 188 | + --no-goma \ |
| 189 | + --target-toolchain _ \ |
| 190 | + --target-sysroot _ \ |
| 191 | + --target-triple _ \ |
| 192 | + --runtime-mode=${{ matrix.mode }} \ |
| 193 | + --disable-desktop-embeddings \ |
| 194 | + --target-dir build |
| 195 | + ninja -C src/out/build clang_x64/gen_snapshot |
| 196 | +
|
| 197 | + - uses: actions/upload-artifact@v3 |
| 198 | + with: |
| 199 | + name: tizen-${{ matrix.arch }}-${{ matrix.mode }}_darwin-x64 |
| 200 | + path: src/out/build/clang_x64/gen_snapshot |
| 201 | + if-no-files-found: error |
| 202 | + |
| 203 | + release: |
| 204 | + needs: [build, windows-build, macos-build] |
| 205 | + if: ${{ github.event_name == 'push' }} |
| 206 | + runs-on: ubuntu-latest |
| 207 | + |
| 208 | + steps: |
| 209 | + - uses: actions/checkout@v3 |
| 210 | + |
| 211 | + - uses: actions/download-artifact@v3 |
| 212 | + |
| 213 | + - name: Create archives |
| 214 | + run: | |
| 215 | + for name in tizen-*; do |
| 216 | + 7z a $name.zip ./$name/* |
| 217 | + done |
| 218 | +
|
| 219 | + - name: Set variables |
| 220 | + run: | |
| 221 | + echo "SHORT_SHA=$(git rev-parse --short $GITHUB_SHA)" >> $GITHUB_ENV |
| 222 | + echo "VERSION=$(echo "${{ github.ref_name }}" | cut -d'-' -f2)" >> $GITHUB_ENV |
| 223 | +
|
| 224 | + - uses: softprops/action-gh-release@v1 |
| 225 | + with: |
| 226 | + name: ${{ env.VERSION }} (${{ env.SHORT_SHA }}) |
| 227 | + tag_name: ${{ env.SHORT_SHA }} |
| 228 | + target_commitish: ${{ github.sha }} |
| 229 | + files: tizen-*.zip |
| 230 | + body: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} |
0 commit comments