Towards https://github.com/flutter/flutter/issues/162201. **NOTE**: This renames the environment variable to `FLUTTER_PREBUILT_ENGINE_VERSION`. --- We occasionally break ourselves, our users, and the Dart up (or is it down? side-ways) stream repos (i.e. HHH) when we change how the undocumented [`update_engine_version.sh`](https://github.com/flutter/flutter/blob/master/bin/internal/update_engine_version.sh) script, and it's Windows counterpart [`update_engine_version.ps1`](https://github.com/flutter/flutter/blob/master/bin/internal/update_engine_version.ps1) work, but have no way of knowing until N days/weeks later when someone tells us. For example, <https://flutter-review.googlesource.com/c/recipes/+/62400>. This is my attempt to encode "this is what you can guarantee by calling this script". It _still_ will be an internal only API that we might rev at any time, but at least we: 1. Can tell the Dart team "this is tested and how it works" 2. If we want to change it, the tests will keep us from changing it without informing folks it changed These tests should (in theory) cover both Linux/MacOS and Windows. /cc @a-siva
42 lines
1.3 KiB
YAML
42 lines
1.3 KiB
YAML
# Copyright 2013 The Flutter Authors. All rights reserved.
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
# found in the LICENSE file.
|
|
|
|
name: Generate Changed Files JSON
|
|
|
|
on:
|
|
pull_request:
|
|
types:
|
|
- opened
|
|
- synchronize
|
|
|
|
jobs:
|
|
generate-json:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Fetch base commit and origin/master
|
|
# Fetch what to compare the commit against
|
|
run: |
|
|
git fetch --no-tags --prune --depth=1 origin ${{ github.event.pull_request.base.sha }}
|
|
git fetch --no-tags --prune --depth=1 origin master
|
|
echo "FLUTTER_PREBUILT_ENGINE_VERSION=${{ github.event.pull_request.base.sha }}" >> "$GITHUB_ENV"
|
|
|
|
- name: Initialize Dart SDK
|
|
# This downloads the version of the Dart SDK for the current platform.
|
|
run: |
|
|
./bin/dart --version
|
|
cd dev/tools && ../../bin/dart pub get
|
|
|
|
- name: Write changed files to a JSON file
|
|
run: |
|
|
./bin/dart run dev/tools/bin/get_files_changed.dart --since="${{ github.event.pull_request.base.sha }}" > changed_files.json
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: changed-files
|
|
path: changed_files.json
|