-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
185 lines (155 loc) Β· 7.83 KB
/
mobile-daily-internal.yml
File metadata and controls
185 lines (155 loc) Β· 7.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
name: "Internal release (photos)"
on:
schedule:
# Runs daily at 12:30 UTC (6:00 PM IST)
- cron: "30 12 * * 1-3"
workflow_dispatch: # Allow manual trigger
env:
FLUTTER_VERSION: "3.32.8"
RUST_VERSION: "1.90.0"
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: mobile/apps/photos
steps:
- name: Checkout code and submodules
uses: actions/checkout@v4
with:
submodules: recursive
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
android: false
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
tool-cache: true
- 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: Install Rust ${{ env.RUST_VERSION }}
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ env.RUST_VERSION }}
- name: Resolve dependencies with lockfile enforcement
run: flutter pub get --enforce-lockfile
- name: Install Flutter Rust Bridge
run: cargo install flutter_rust_bridge_codegen
- name: Generate Rust bindings (Core)
run: flutter_rust_bridge_codegen generate
working-directory: mobile/packages/rust
- name: Generate Rust bindings
run: flutter_rust_bridge_codegen generate
- name: Increment version code for build
run: |
CURRENT_VERSION=$(grep '^version:' pubspec.yaml | sed 's/version: //')
VERSION_NAME=$(echo $CURRENT_VERSION | cut -d'+' -f1)
CURRENT_BUILD=$(echo $CURRENT_VERSION | cut -d'+' -f2)
NEW_VERSION_CODE=$((CURRENT_BUILD + ${{ github.run_number }}))
NEW_VERSION="${VERSION_NAME}+${NEW_VERSION_CODE}"
sed -i "s/^version: .*/version: $NEW_VERSION/" pubspec.yaml
echo "Building with version ${NEW_VERSION}"
# Store version for later use
echo "NEW_VERSION=${NEW_VERSION}" >> $GITHUB_ENV
echo "NEW_VERSION_CODE=${NEW_VERSION_CODE}" >> $GITHUB_ENV
- name: Prepare and validate changelog for Play Store
run: |
mkdir -p whatsnew
CHANGELOG_FILE="scripts/store_changes.txt"
DISCORD_FILE="scripts/internal_changes.txt"
OUTPUT_FILE="whatsnew/whatsnew-en-US"
# Use provided changelog or fallback
if [ -f "$CHANGELOG_FILE" ]; then
head -c 500 "$CHANGELOG_FILE" > "$OUTPUT_FILE"
else
echo "Bug fixes and improvements" > "$OUTPUT_FILE"
fi
# Validate: file exists
if [ ! -s "$OUTPUT_FILE" ]; then
echo "β Changelog is empty."
exit 1
fi
# Validate: <= 500 chars
LENGTH=$(wc -m < "$OUTPUT_FILE")
if [ "$LENGTH" -gt 500 ]; then
echo "β Changelog exceeds 500 characters ($LENGTH)."
exit 1
fi
# Validate: no markdown or HTML
if grep -Eq '[\*\_\<\>\[\]\(\)]' "$OUTPUT_FILE"; then
echo "β Changelog contains markdown/HTML formatting."
exit 1
fi
echo "β
Changelog valid:"
cat "$OUTPUT_FILE"
# Store changelog for Play Store (with escaped newlines)
CHANGELOG_PLAYSTORE=$(cat "$OUTPUT_FILE" | sed ':a;N;$!ba;s/\n/\\n/g' | sed 's/"/\\"/g')
echo "CHANGELOG=${CHANGELOG_PLAYSTORE}" >> $GITHUB_ENV
# Store changelog for Discord (with proper newlines)
CHANGELOG_DISCORD=$(cat "$DISCORD_FILE" | sed 's/"/\\"/g')
echo "CHANGELOG_DISCORD<<EOF" >> $GITHUB_ENV
echo "$CHANGELOG_DISCORD" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Setup keys
uses: timheuer/base64-to-file@v1
with:
fileName: "keystore/ente_photos_key.jks"
encodedString: ${{ secrets.SIGNING_KEY_PHOTOS }}
- name: Disk report (before build)
run: |
echo "=== Disk space (df -h) ==="
df -h
echo ""
echo "=== Inodes (df -i) ==="
df -i
echo ""
echo "=== Largest cache directories (top 50) ==="
du -xh -d 2 "$HOME/.gradle" "$HOME/.pub-cache" "$HOME/.cargo" 2>/dev/null | sort -h | tail -n 50 || true
echo ""
echo "=== Largest workspace directories (android/build) (top 50) ==="
du -xh -d 3 "$GITHUB_WORKSPACE/mobile/apps/photos/android" "$GITHUB_WORKSPACE/mobile/apps/photos/build" 2>/dev/null | sort -h | tail -n 50 || true
- name: Build PlayStore AAB
run: |
flutter build appbundle --dart-define=cronetHttpNoPlay=true --release --flavor playstore --target-platform android-arm,android-arm64
env:
SIGNING_KEY_PATH: "/home/runner/work/_temp/keystore/ente_photos_key.jks"
SIGNING_KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS_PHOTOS }}
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD_PHOTOS }}
SIGNING_STORE_PASSWORD: ${{ secrets.SIGNING_STORE_PASSWORD_PHOTOS }}
- name: Upload AAB to PlayStore
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }}
packageName: io.ente.photos
releaseFiles: mobile/apps/photos/build/app/outputs/bundle/playstoreRelease/app-playstore-release.aab
track: internal
whatsNewDirectory: mobile/apps/photos/whatsnew
mappingFile: mobile/apps/photos/build/app/outputs/mapping/playstoreRelease/mapping.txt
- name: Notify Discord
uses: sarisia/actions-status-discord@v1
with:
webhook: ${{ secrets.DISCORD_INTERNAL_RELEASE_WEBHOOK }}
nodetail: true
title: "π Nightly build Photos v${{ env.NEW_VERSION }} (Branch: ${{ github.ref_name }})"
description: |
**Version:** ${{ env.NEW_VERSION }}
**Flutter:** ${{ env.FLUTTER_VERSION }}
**Commit:** [${{ github.sha }}](${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }})
**Download:** [Play Store](https://play.google.com/store/apps/details?id=io.ente.photos)
**Sentry:** [Exceptions](https://sentry.ente.io/organizations/ente/issues/?environment=production&project=2&query=release.build%3A%3E%3D${{ env.NEW_VERSION_CODE }}&referrer=issue-list&statsPeriod=7d)
**Changes:**
${{ env.CHANGELOG_DISCORD }}
color: 0x00ff00