Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Add GitHub release workflow and auto-publish internal releases for locker

AmanRajSinghMourya942193465f05
diff --git a/.github/workflows/locker-internal-release.yml b/.github/workflows/locker-internal-release.yml
index 1a57e36235..e6f0565f0d 100644
--- a/.github/workflows/locker-internal-release.yml
+++ b/.github/workflows/locker-internal-release.yml
@@ -61,7 +61,6 @@ jobs:
packageName: io.ente.locker
releaseFiles: mobile/apps/locker/build/app/outputs/bundle/playstoreRelease/app-playstore-release.aab
track: internal
- status: draft
- name: Notify Discord
uses: sarisia/actions-status-discord@v1
diff --git a/.github/workflows/locker-release.yml b/.github/workflows/locker-release.yml
new file mode 100644
index 0000000000..7907df8026
--- /dev/null
+++ b/.github/workflows/locker-release.yml
@@ -0,0 +1,102 @@
+name: "Release (locker independent)"
+
+on:
+ workflow_dispatch: # Allow manually running the action
+ push:
+ # Run when a tag matching the pattern "locker-v*" is pushed
+ # See: [Note: Testing release workflows that are triggered by tags]
+ tags:
+ - "locker-v*"
+
+env:
+ FLUTTER_VERSION: "3.32.8"
+
+permissions:
+ contents: write
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+
+ defaults:
+ run:
+ working-directory: mobile/apps/locker
+
+ steps:
+ - name: Checkout code and submodules
+ uses: actions/checkout@v4
+ with:
+ submodules: recursive
+
+ - name: Free up disk space
+ run: |
+ echo "Initial disk usage:"
+ df -h /
+ # Get available space in KB
+ INITIAL=$(df / | awk 'NR==2 {print $4}')
+
+ echo -e "\n=== Removing .NET SDK (~20-25GB) ==="
+ BEFORE=$(df / | awk 'NR==2 {print $4}')
+ START=$(date +%s)
+ sudo rm -rf /usr/share/dotnet
+ END=$(date +%s)
+ AFTER=$(df / | awk 'NR==2 {print $4}')
+ FREED=$(( (AFTER - BEFORE) / 1048576 )) # Convert KB to GB
+ echo "Time: $((END-START))s | Freed: ${FREED}GB"
+
+ echo -e "\n=== Removing cached tools (~5-10GB) ==="
+ BEFORE=$(df / | awk 'NR==2 {print $4}')
+ START=$(date +%s)
+ sudo rm -rf "$AGENT_TOOLSDIRECTORY"
+ END=$(date +%s)
+ AFTER=$(df / | awk 'NR==2 {print $4}')
+ FREED=$(( (AFTER - BEFORE) / 1048576 ))
+ echo "Time: $((END-START))s | Freed: ${FREED}GB"
+
+ echo -e "\n=== Final Summary ==="
+ FINAL=$(df / | awk 'NR==2 {print $4}')
+ TOTAL_FREED=$(( (FINAL - INITIAL) / 1048576 ))
+ echo "Total space freed: ${TOTAL_FREED}GB"
+ echo "Final disk usage:"
+ df -h /
+
+ - name: Setup JDK 17
+ uses: actions/setup-java@v1
+ with:
+ java-version: 17
+
+ - name: Install Flutter ${{ env.FLUTTER_VERSION }}
+ uses: subosito/flutter-action@v2
+ with:
+ channel: "stable"
+ flutter-version: ${{ env.FLUTTER_VERSION }}
+ cache: true
+
+ - name: Generate strings localizations
+ run: flutter gen-l10n
+ working-directory: mobile/packages/strings
+
+ - name: Setup keys
+ uses: timheuer/base64-to-file@v1
+ with:
+ fileName: "keystore/ente_locker_key.jks"
+ encodedString: ${{ secrets.SIGNING_KEY_LOCKER }}
+
+ - name: Build independent APK
+ run: |
+ flutter build apk --dart-define=cronetHttpNoPlay=true --release --flavor independent
+ mv build/app/outputs/flutter-apk/app-independent-release.apk build/app/outputs/flutter-apk/ente-${{ github.ref_name }}.apk
+ env:
+ SIGNING_KEY_PATH: "/home/runner/work/_temp/keystore/ente_locker_key.jks"
+ SIGNING_KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS_LOCKER }}
+ SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD_LOCKER }}
+ SIGNING_STORE_PASSWORD: ${{ secrets.SIGNING_STORE_PASSWORD_LOCKER }}
+
+ - name: Checksum
+ run: sha256sum build/app/outputs/flutter-apk/ente-${{ github.ref_name }}.apk > build/app/outputs/flutter-apk/sha256sum
+
+ - name: Create a draft GitHub release
+ uses: ncipollo/release-action@v1
+ with:
+ artifacts: "mobile/apps/locker/build/app/outputs/flutter-apk/ente-${{ github.ref_name }}.apk,mobile/apps/locker/build/app/outputs/flutter-apk/sha256sum"
+ draft: true