Skip to content

Generate and upload artifacts through Github actions workflow. #10

Generate and upload artifacts through Github actions workflow.

Generate and upload artifacts through Github actions workflow. #10

name: Build and Upload Engine Artifacts
on:
pull_request:
env:
DEPOT_TOOLS_WIN_TOOLCHAIN: 0
FLUTTER_PREBUILT_DART_SDK: 1
R2_BUCKET: flutter-zero-engine
jobs:
host_debug_framework:
runs-on: macos-latest
defaults:
run:
shell: bash
steps:
- name: Check out the repository
uses: actions/checkout@v4
with:
path: ''
- name: Set up depot_tools / gclient
shell: bash
run: |
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git $HOME/depot_tools
# Append depot_tools to the PATH for subsequent steps
echo "$HOME/depot_tools" >> $GITHUB_PATH
- name: Generate engine content hash
id: engine_content_hash
run: |
engine_content_hash=$(bin/internal/content_aware_hash.sh)
echo "::notice:: Engine content hash: ${engine_content_hash}"
echo "value=${engine_content_hash}" >> $GITHUB_OUTPUT
- name: Copy gclient file
run: |
cp engine/scripts/slim.gclient .gclient
- name: Gclient sync
shell: bash
run: |
gclient sync -D --no-history --shallow --with_branch_heads
- name: Build Engine
shell: bash
run: |
cd engine/src
./flutter/bin/et build --config ci/host_debug_framework
- name: Delete intermediate files
shell: bash
run: |
rm -rf engine/src/out/ci/host_debug_framework/obj
rm -rf engine/src/out/ci/host_debug_framework/gen
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: artifacts-mac-host-debug-framework
path: engine/src/out/ci/host_debug_framework
# - name: Upload Artifacts
# uses: ryand56/r2-upload-action@b801a390acbdeb034c5e684ff5e1361c06639e7c
# with:
# r2-account-id: ${{ secrets.R2_ACCOUNT_ID }}
# r2-access-key-id: ${{ secrets.R2_ACCESS_KEY_ID }}
# r2-secret-access-key: ${{ secrets.R2_SECRET_ACCESS_KEY }}
# r2-bucket: ${{ env.R2_BUCKET }}
# source-dir: engine/src/out/ci/host_debug/zip_archives/darwin-x64/artifacts.zip
# destination-dir: ${{ steps.engine_content_hash.outputs.value }}/darwin-x64
# - name: Upload Artifacts
# uses: ryand56/r2-upload-action@b801a390acbdeb034c5e684ff5e1361c06639e7c
# with:
# r2-account-id: ${{ secrets.R2_ACCOUNT_ID }}
# r2-access-key-id: ${{ secrets.R2_ACCESS_KEY_ID }}
# r2-secret-access-key: ${{ secrets.R2_SECRET_ACCESS_KEY }}
# r2-bucket: ${{ env.R2_BUCKET }}
# source-dir: engine/src/out/ci/host_debug/zip_archives/dart-sdk-darwin-x64.zip
# destination-dir: ${{ steps.engine_content_hash.outputs.value }}/
mac_debug_framework_arm64:
runs-on: macos-latest
defaults:
run:
shell: bash
steps:
- name: Check out the repository
uses: actions/checkout@v4
with:
path: ''
- name: Set up depot_tools / gclient
shell: bash
run: |
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git $HOME/depot_tools
# Append depot_tools to the PATH for subsequent steps
echo "$HOME/depot_tools" >> $GITHUB_PATH
- name: Generate engine content hash
id: engine_content_hash
run: |
engine_content_hash=$(bin/internal/content_aware_hash.sh)
echo "::notice:: Engine content hash: ${engine_content_hash}"
echo "value=${engine_content_hash}" >> $GITHUB_OUTPUT
- name: Copy gclient file
run: |
cp engine/scripts/slim.gclient .gclient
- name: Gclient sync
shell: bash
run: |
gclient sync -D --no-history --shallow --with_branch_heads
- name: Build Engine
shell: bash
run: |
cd engine/src
./flutter/bin/et build --config ci/mac_debug_framework_arm64
- name: Delete intermediate files
shell: bash
run: |
rm -rf engine/src/out/ci/mac_debug_framework_arm64/obj
rm -rf engine/src/out/ci/mac_debug_framework_arm64/gen
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: artifacts-mac_debug_framework_arm64
path: engine/src/out/ci/mac_debug_framework_arm64
mac_global:
runs-on: macos-latest
needs:
- host_debug_framework
- mac_debug_framework_arm64
steps:
- name: Check out the repository
uses: actions/checkout@v4
with:
path: ''
- name: Copy gclient file
run: |
cp engine/scripts/slim.gclient .gclient
- name: Gclient sync
shell: bash
run: |
gclient sync -D --no-history --shallow --with_branch_heads
- name: Download host_debug_framework artifacts
uses: actions/download-artifact@v4
with:
name: artifacts-mac-host-debug-framework
path: engine/src/out/ci/host_debug_framework
- name: Download mac_debug_framework_arm64 artifacts
uses: actions/download-artifact@v4
with:
name: artifacts-mac_debug_framework_arm64
path: engine/src/out/ci/mac_debug_framework_arm64
- name: Create-Debug-FlutterEmbedder.framework
shell: bash
run: |
cd engine/src
flutter/sky/tools/create_embedder_framework.py --dst out/debug/framework --arm64-out-dir out/ci/mac_debug_framework_arm64 --x64-out-dir out/ci/host_debug_framework --zip
- name: Generate engine content hash
id: engine_content_hash
run: |
engine_content_hash=$(bin/internal/content_aware_hash.sh)
echo "::notice:: Engine content hash: ${engine_content_hash}"
echo "value=${engine_content_hash}" >> $GITHUB_OUTPUT
- name: Upload Artifacts
uses: ryand56/r2-upload-action@b801a390acbdeb034c5e684ff5e1361c06639e7c
with:
r2-account-id: ${{ secrets.R2_ACCOUNT_ID }}
r2-access-key-id: ${{ secrets.R2_ACCESS_KEY_ID }}
r2-secret-access-key: ${{ secrets.R2_SECRET_ACCESS_KEY }}
r2-bucket: ${{ env.R2_BUCKET }}
source-dir: out/debug/framework/FlutterEmbedder.framework.zip
destination-dir: ${{ steps.engine_content_hash.outputs.value }}/darwin-x64/