Generate and upload artifacts through Github actions workflow. #7
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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: '' | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.13' | |
| - 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 | |
| - 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 }}/ | |