π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Add local Flutter setup action
Manav Rathib9f21c47e06d
diff --git a/.github/actions/setup-flutter/action.yml b/.github/actions/setup-flutter/action.ymlnew file mode 100644index 0000000000..e1811b0f2a--- /dev/null+++ b/.github/actions/setup-flutter/action.yml@@ -0,0 +1,48 @@+name: "Setup Flutter"+description: "Install the Flutter SDK version used by Ente CI"++runs:+ using: "composite"+ steps:+ - shell: bash+ env:+ FLUTTER_VERSION: "3.38.10"+ run: |+ set -euo pipefail++ base_url="https://storage.googleapis.com/flutter_infra_release/releases"+ case "$RUNNER_OS-$RUNNER_ARCH" in+ Linux-X64) archive="stable/linux/flutter_linux_${FLUTTER_VERSION}-stable.tar.xz" ;;+ macOS-X64) archive="stable/macos/flutter_macos_${FLUTTER_VERSION}-stable.zip" ;;+ macOS-ARM64) archive="stable/macos/flutter_macos_arm64_${FLUTTER_VERSION}-stable.zip" ;;+ Windows-X64) archive="stable/windows/flutter_windows_${FLUTTER_VERSION}-stable.zip" ;;+ esac++ temp_dir="$RUNNER_TEMP"+ if [ "$RUNNER_OS" = Windows ]; then+ temp_dir="$(cygpath -u "$temp_dir")"+ fi++ install_root="$temp_dir/flutter-sdk"+ flutter_root="$install_root/flutter"++ github_path() {+ if [ "$RUNNER_OS" = Windows ]; then+ cygpath -w "$1"+ else+ printf '%s\n' "$1"+ fi+ }++ archive_name="${archive##*/}"+ archive_path="$temp_dir/$archive_name"++ curl -fsSL "$base_url/$archive" -o "$archive_path"+ mkdir -p "$install_root"+ case "$archive_name" in+ *.zip) unzip -q -o "$archive_path" -d "$install_root" ;;+ *) tar xf "$archive_path" -C "$install_root" ;;+ esac+ rm -f "$archive_path"++ github_path "$flutter_root/bin" >>"$GITHUB_PATH"diff --git a/.github/workflows/auth-build.yml b/.github/workflows/auth-build.ymlindex 650b2b2219..0555ada089 100644--- a/.github/workflows/auth-build.yml+++ b/.github/workflows/auth-build.yml@@ -11,9 +11,6 @@ on:# Run every weekday at ~3:45 AM IST- cron: "15 22 * * 0-4"-env:- FLUTTER_VERSION: "3.38.10"-permissions:contents: write@@ -116,11 +113,8 @@ jobs:distribution: "temurin"java-version: "17"- - name: Install Flutter ${{ env.FLUTTER_VERSION }}- uses: subosito/flutter-action@1a449444c387b1966244ae4d4f8c696479add0b2 # v2.23.0- with:- channel: "stable"- flutter-version: ${{ env.FLUTTER_VERSION }}+ - name: Install Flutter+ uses: ./.github/actions/setup-flutter- name: Generate strings localizationsrun: flutter gen-l10n@@ -244,11 +238,8 @@ jobs:ref: ${{ needs.build-metadata.outputs.commit_sha }}submodules: recursive- - name: Install Flutter ${{ env.FLUTTER_VERSION }}- uses: subosito/flutter-action@1a449444c387b1966244ae4d4f8c696479add0b2 # v2.23.0- with:- channel: "stable"- flutter-version: ${{ env.FLUTTER_VERSION }}+ - name: Install Flutter+ uses: ./.github/actions/setup-flutter- name: Generate strings localizationsrun: flutter gen-l10n@@ -285,11 +276,11 @@ jobs:./linux/packaging/build_rpm.shmv dist/*/*.rpm "artifacts/${ARTIFACT_STEM}-x86_64.rpm"dart pub global activate --source git https://github.com/ente-io/fastforgefork --git-ref develop --git-path packages/fastforge- fastforge package --platform=linux --targets=appimage --skip-clean+ dart pub global run fastforge package --platform=linux --targets=appimage --skip-cleanappimage_path="$(find dist -name '*-*-linux.AppImage' -print -quit)"./linux/packaging/post_process_appimage.sh "$appimage_path"mv "$appimage_path" "artifacts/${ARTIFACT_STEM}-x86_64.AppImage"- fastforge package --platform=linux --targets=deb --skip-clean+ dart pub global run fastforge package --platform=linux --targets=deb --skip-cleanmv dist/**/*-*-linux.deb "artifacts/${ARTIFACT_STEM}-x86_64.deb"- name: Generate checksums@@ -362,11 +353,8 @@ jobs:ref: ${{ needs.build-metadata.outputs.commit_sha }}submodules: recursive- - name: Install Flutter ${{ env.FLUTTER_VERSION }}- uses: subosito/flutter-action@1a449444c387b1966244ae4d4f8c696479add0b2 # v2.23.0- with:- channel: "stable"- flutter-version: ${{ env.FLUTTER_VERSION }}+ - name: Install Flutter+ uses: ./.github/actions/setup-flutter- name: Generate strings localizationsrun: flutter gen-l10n@@ -514,12 +502,8 @@ jobs:ref: ${{ needs.build-metadata.outputs.commit_sha }}submodules: recursive- - name: Install Flutter ${{ env.FLUTTER_VERSION }}- uses: subosito/flutter-action@1a449444c387b1966244ae4d4f8c696479add0b2 # v2.23.0- with:- channel: "stable"- flutter-version: ${{ env.FLUTTER_VERSION }}- cache: true+ - name: Install Flutter+ uses: ./.github/actions/setup-flutter- name: Generate strings localizationsrun: flutter gen-l10n@@ -654,12 +638,8 @@ jobs:ref: ${{ needs.build-metadata.outputs.commit_sha }}submodules: recursive- - name: Install Flutter ${{ env.FLUTTER_VERSION }}- uses: subosito/flutter-action@1a449444c387b1966244ae4d4f8c696479add0b2 # v2.23.0- with:- channel: "stable"- flutter-version: ${{ env.FLUTTER_VERSION }}- cache: true+ - name: Install Flutter+ uses: ./.github/actions/setup-flutter- name: Generate strings localizationsrun: flutter gen-l10ndiff --git a/.github/workflows/locker-build.yml b/.github/workflows/locker-build.ymlindex 52e30d1c99..70a52e4f37 100644--- a/.github/workflows/locker-build.yml+++ b/.github/workflows/locker-build.yml@@ -11,9 +11,6 @@ on:# Run every weekday at ~4:45 AM IST- cron: "15 23 * * 0-4"-env:- FLUTTER_VERSION: "3.38.10"-permissions:contents: write@@ -115,11 +112,8 @@ jobs:distribution: "temurin"java-version: "17"- - name: Install Flutter ${{ env.FLUTTER_VERSION }}- uses: subosito/flutter-action@1a449444c387b1966244ae4d4f8c696479add0b2 # v2.23.0- with:- channel: "stable"- flutter-version: ${{ env.FLUTTER_VERSION }}+ - name: Install Flutter+ uses: ./.github/actions/setup-flutter- name: Generate strings localizationsrun: flutter gen-l10n@@ -240,12 +234,8 @@ jobs:with:ref: ${{ needs.build-metadata.outputs.commit_sha }}- - name: Install Flutter ${{ env.FLUTTER_VERSION }}- uses: subosito/flutter-action@1a449444c387b1966244ae4d4f8c696479add0b2 # v2.23.0- with:- channel: "stable"- flutter-version: ${{ env.FLUTTER_VERSION }}- cache: true+ - name: Install Flutter+ uses: ./.github/actions/setup-flutter- name: Generate strings localizationsrun: flutter gen-l10ndiff --git a/.github/workflows/mobile-lint.yml b/.github/workflows/mobile-lint.ymlindex 6db74a8105..7006dce8fb 100644--- a/.github/workflows/mobile-lint.yml+++ b/.github/workflows/mobile-lint.yml@@ -15,9 +15,6 @@ on:- "rust/crates/photos/**"workflow_dispatch:-env:- FLUTTER_VERSION: "3.38.10"-permissions:contents: read@@ -65,12 +62,8 @@ jobs:doneworking-directory: mobile/apps/auth- - name: Install Flutter ${{ env.FLUTTER_VERSION }}- uses: subosito/flutter-action@1a449444c387b1966244ae4d4f8c696479add0b2 # v2.23.0- with:- channel: "stable"- flutter-version: ${{ env.FLUTTER_VERSION }}- cache: true+ - name: Install Flutter+ uses: ./.github/actions/setup-flutter# Restore-only; primed on main by warm-caches.yml.- name: Restore Rust cachediff --git a/.github/workflows/photos-build.yml b/.github/workflows/photos-build.ymlindex 185521b721..76ee97b3c5 100644--- a/.github/workflows/photos-build.yml+++ b/.github/workflows/photos-build.yml@@ -11,9 +11,6 @@ on:# Run every weekday at ~2:35 AM IST- cron: "5 21 * * 0-4"-env:- FLUTTER_VERSION: "3.38.10"-permissions:contents: write@@ -115,11 +112,8 @@ jobs:distribution: "temurin"java-version: "17"- - name: Install Flutter ${{ env.FLUTTER_VERSION }}- uses: subosito/flutter-action@1a449444c387b1966244ae4d4f8c696479add0b2 # v2.23.0- with:- channel: "stable"- flutter-version: ${{ env.FLUTTER_VERSION }}+ - name: Install Flutter+ uses: ./.github/actions/setup-flutter- name: Set build versionrun: node ../../../.github/scripts/flutter-version.mjs photos set-build "${RELEASE_VERSION}" "${BUILD_NUMBER}"@@ -236,12 +230,8 @@ jobs:with:ref: ${{ needs.build-metadata.outputs.commit_sha }}- - name: Install Flutter ${{ env.FLUTTER_VERSION }}- uses: subosito/flutter-action@1a449444c387b1966244ae4d4f8c696479add0b2 # v2.23.0- with:- channel: "stable"- flutter-version: ${{ env.FLUTTER_VERSION }}- cache: true+ - name: Install Flutter+ uses: ./.github/actions/setup-flutter- name: Set build versionrun: node ../../../.github/scripts/flutter-version.mjs photos set-build "${RELEASE_VERSION}" "${BUILD_NUMBER}"diff --git a/.github/workflows/warm-caches.yml b/.github/workflows/warm-caches.ymlindex c3320f3803..cca4215d56 100644--- a/.github/workflows/warm-caches.yml+++ b/.github/workflows/warm-caches.yml@@ -62,11 +62,7 @@ jobs:submodules: recursive- name: Install Flutter- uses: subosito/flutter-action@1a449444c387b1966244ae4d4f8c696479add0b2 # v2.23.0- with:- channel: "stable"- flutter-version: "3.38.10" # Keep in sync with mobile-lint.yml- cache: true+ uses: ./.github/actions/setup-flutter- name: Setup Rust cacheuses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1