|
|
|
|
@ -102,7 +102,7 @@ jobs:
|
|
|
|
|
env:
|
|
|
|
|
GIPHY_API_KEY: ${{ secrets.GIPHY_API_KEY }}
|
|
|
|
|
run: jq -n --arg k "$GIPHY_API_KEY" '{GIPHY_API_KEY:$k}' > dart_defines.json
|
|
|
|
|
- run: flutter build apk --release --no-pub --dart-define-from-file=dart_defines.json
|
|
|
|
|
- run: bash .github/scripts/flutter-build-retry.sh flutter build apk --release --no-pub --dart-define-from-file=dart_defines.json
|
|
|
|
|
if: needs.classify.outputs.docs_only != 'true'
|
|
|
|
|
- name: Upload APK
|
|
|
|
|
if: needs.classify.outputs.docs_only != 'true'
|
|
|
|
|
@ -136,7 +136,7 @@ jobs:
|
|
|
|
|
env:
|
|
|
|
|
GIPHY_API_KEY: ${{ secrets.GIPHY_API_KEY }}
|
|
|
|
|
run: jq -n --arg k "$GIPHY_API_KEY" '{GIPHY_API_KEY:$k}' > dart_defines.json
|
|
|
|
|
- run: flutter build ios --release --no-codesign --no-pub --dart-define-from-file=dart_defines.json
|
|
|
|
|
- run: bash .github/scripts/flutter-build-retry.sh flutter build ios --release --no-codesign --no-pub --dart-define-from-file=dart_defines.json
|
|
|
|
|
if: needs.classify.outputs.docs_only != 'true'
|
|
|
|
|
# The assertion must be able to fail, so it runs against an empty app first.
|
|
|
|
|
- name: "Negative: the framework assertion refuses an empty app"
|
|
|
|
|
@ -277,6 +277,32 @@ jobs:
|
|
|
|
|
fi
|
|
|
|
|
done
|
|
|
|
|
echo "Accepted only CI and docs changes from a real tag, as required."
|
|
|
|
|
# The build retry (#1347) must re-run only a native-assets failure, and
|
|
|
|
|
# must still fail when that failure doesn't clear or another one hits.
|
|
|
|
|
- name: "Negative: the build retry re-runs only a native-assets failure"
|
|
|
|
|
if: needs.classify.outputs.docs_only != 'true'
|
|
|
|
|
run: |
|
|
|
|
|
set -u
|
|
|
|
|
RETRY="${GITHUB_WORKSPACE}/.github/scripts/flutter-build-retry.sh"
|
|
|
|
|
T="${RUNNER_TEMP}/retry-check"
|
|
|
|
|
mkdir -p "${T}"
|
|
|
|
|
# fake <count file> <failures before success> <message>
|
|
|
|
|
printf '%s\n' \
|
|
|
|
|
'n=$(( $(cat "$1" 2>/dev/null || echo 0) + 1 )); echo "$n" > "$1"' \
|
|
|
|
|
'if [ "$n" -le "$2" ]; then echo "$3"; exit 1; fi' \
|
|
|
|
|
'echo built' > "${T}/fake.sh"
|
|
|
|
|
run() { rm -f "${T}/count"; bash "${RETRY}" bash "${T}/fake.sh" "${T}/count" "$@" > /dev/null; }
|
|
|
|
|
calls() { cat "${T}/count"; }
|
|
|
|
|
NA='Target dart_build failed: Error: Building native assets failed.'
|
|
|
|
|
run 0 "${NA}" || { echo "::error::A clean build was reported as failed."; exit 1; }
|
|
|
|
|
[ "$(calls)" = 1 ] || { echo "::error::A clean build ran $(calls) times."; exit 1; }
|
|
|
|
|
run 1 "${NA}" || { echo "::error::A native-assets failure that cleared on retry still failed."; exit 1; }
|
|
|
|
|
[ "$(calls)" = 2 ] || { echo "::error::A cleared native-assets failure ran $(calls) times, not 2."; exit 1; }
|
|
|
|
|
if run 9 "${NA}"; then echo "::error::A native-assets failure that never cleared passed."; exit 1; fi
|
|
|
|
|
[ "$(calls)" = 3 ] || { echo "::error::A lasting native-assets failure ran $(calls) times, not 3."; exit 1; }
|
|
|
|
|
if run 1 "error: compile failed in lib/main.dart"; then echo "::error::A compile error was retried into a pass."; exit 1; fi
|
|
|
|
|
[ "$(calls)" = 1 ] || { echo "::error::A compile error was retried ($(calls) runs)."; exit 1; }
|
|
|
|
|
echo "Retried only native-assets failures, at most 3 attempts, as required."
|
|
|
|
|
- uses: subosito/flutter-action@v2
|
|
|
|
|
if: needs.classify.outputs.docs_only != 'true'
|
|
|
|
|
with:
|
|
|
|
|
@ -297,7 +323,7 @@ jobs:
|
|
|
|
|
- name: Enable native assets (bundles sqlite3 + llamadart libs, #445)
|
|
|
|
|
if: needs.classify.outputs.docs_only != 'true'
|
|
|
|
|
run: flutter config --enable-native-assets
|
|
|
|
|
- run: flutter build linux --release --no-pub --dart-define-from-file=dart_defines.json
|
|
|
|
|
- run: bash .github/scripts/flutter-build-retry.sh flutter build linux --release --no-pub --dart-define-from-file=dart_defines.json
|
|
|
|
|
if: needs.classify.outputs.docs_only != 'true'
|
|
|
|
|
- name: Upload Linux bundle
|
|
|
|
|
if: needs.classify.outputs.docs_only != 'true'
|
|
|
|
|
@ -334,7 +360,7 @@ jobs:
|
|
|
|
|
- name: Enable native assets (bundles sqlite3 + llamadart libs, #445)
|
|
|
|
|
if: needs.classify.outputs.docs_only != 'true'
|
|
|
|
|
run: flutter config --enable-native-assets
|
|
|
|
|
- run: flutter build macos --release --no-pub --dart-define-from-file=dart_defines.json
|
|
|
|
|
- run: bash .github/scripts/flutter-build-retry.sh flutter build macos --release --no-pub --dart-define-from-file=dart_defines.json
|
|
|
|
|
if: needs.classify.outputs.docs_only != 'true'
|
|
|
|
|
# ditto, not zip: it preserves the .app bundle's symlinks, which plain
|
|
|
|
|
# zip flattens into copies that break code-signing validation (#1108).
|
|
|
|
|
@ -431,8 +457,9 @@ jobs:
|
|
|
|
|
- name: Enable native assets (bundles sqlite3 + llamadart libs, #445)
|
|
|
|
|
if: needs.classify.outputs.docs_only != 'true'
|
|
|
|
|
run: flutter config --enable-native-assets
|
|
|
|
|
- run: flutter build windows --release --no-pub --dart-define-from-file=dart_defines.json
|
|
|
|
|
- run: bash .github/scripts/flutter-build-retry.sh flutter build windows --release --no-pub --dart-define-from-file=dart_defines.json
|
|
|
|
|
if: needs.classify.outputs.docs_only != 'true'
|
|
|
|
|
shell: bash
|
|
|
|
|
- name: Upload Windows build
|
|
|
|
|
if: needs.classify.outputs.docs_only != 'true'
|
|
|
|
|
uses: actions/upload-artifact@v4
|
|
|
|
|
|