Skip to content

armgit / ente

Public Imported from GitHub
0

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

Add Locker release process

Manav Rathibd257a437f77
diff --git a/.github/docs/app-release.md b/.github/docs/app-release.md
index 47b32cfa08..dc37015ccf 100644
--- a/.github/docs/app-release.md
+++ b/.github/docs/app-release.md
@@ -1,10 +1,10 @@
# App release process
-Auth and Ensu use the same release process, as described here.
+Auth, Locker, and Ensu use the same release process, as described here.
> For simplicity, the following assumes we're trying to release Ensu, that main is `0.1.16-beta`, we want to release `0.1.16` and move main to `0.1.17-beta`.
>
-> To do the same steps for, say, auth, you can just mechanically replace "ensu" with "auth" in the steps.
+> To do the same steps for another app, say "auth", you can just mechanically replace "ensu" with that "auth" in the steps.
## Normal development
diff --git a/.github/scripts/auth-version.mjs b/.github/scripts/flutter-version.mjs
similarity index 64%
rename from .github/scripts/auth-version.mjs
rename to .github/scripts/flutter-version.mjs
index 8e90e3f3c9..455a1db862 100644
--- a/.github/scripts/auth-version.mjs
+++ b/.github/scripts/flutter-version.mjs
@@ -5,7 +5,22 @@ import path from "node:path";
import { fileURLToPath } from "node:url";
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../..");
-const pubspec = path.join(root, "mobile/apps/auth/pubspec.yaml");
+const [app, command = "get", ...args] = process.argv.slice(2);
+
+function usage() {
+ console.error(`Usage:
+ node .github/scripts/flutter-version.mjs auth get
+ node .github/scripts/flutter-version.mjs auth get-build-base
+ node .github/scripts/flutter-version.mjs auth set 4.4.23
+ node .github/scripts/flutter-version.mjs auth set-build 4.4.23 1007`);
+}
+
+if (!app) {
+ usage();
+ process.exit(2);
+}
+
+const pubspec = path.join(root, "mobile/apps", app, "pubspec.yaml");
function read() {
return fs.readFileSync(pubspec, "utf8");
@@ -17,7 +32,7 @@ function write(text) {
function pubspecVersion() {
const match = read().match(/^version:\s*(\d+\.\d+\.\d+)\+(\d+)$/m);
- if (!match) throw new Error("Invalid Auth pubspec version");
+ if (!match) throw new Error(`Invalid ${app} pubspec version`);
return { source: match[1], buildBase: match[2] };
}
@@ -28,31 +43,21 @@ function setPubspecVersion(version) {
count += 1;
return `version: ${version}`;
});
- if (!count) throw new Error("No version field found in mobile/apps/auth/pubspec.yaml");
+ if (!count) throw new Error(`No version field found in ${path.relative(root, pubspec)}`);
write(next);
}
-function usage() {
- console.error(`Usage:
- node .github/scripts/auth-version.mjs get
- node .github/scripts/auth-version.mjs get-build-base
- node .github/scripts/auth-version.mjs set 4.4.23
- node .github/scripts/auth-version.mjs set-build 4.4.23 1007`);
-}
-
-const [command = "get", ...args] = process.argv.slice(2);
-
try {
if (command === "get") {
console.log(pubspecVersion().source);
} else if (command === "get-build-base") {
console.log(pubspecVersion().buildBase);
} else if (command === "set") {
- if (!/^\d+\.\d+\.\d+$/.test(args[0])) throw new Error(`Invalid Auth version: ${args[0]}`);
+ if (!/^\d+\.\d+\.\d+$/.test(args[0])) throw new Error(`Invalid ${app} version: ${args[0]}`);
setPubspecVersion(`${args[0]}+${pubspecVersion().buildBase}`);
} else if (command === "set-build") {
- if (!/^\d+\.\d+\.\d+$/.test(args[0])) throw new Error(`Invalid Auth release version: ${args[0]}`);
- if (!/^\d+$/.test(args[1])) throw new Error(`Invalid Auth build number: ${args[1]}`);
+ if (!/^\d+\.\d+\.\d+$/.test(args[0])) throw new Error(`Invalid ${app} release version: ${args[0]}`);
+ if (!/^\d+$/.test(args[1])) throw new Error(`Invalid ${app} build number: ${args[1]}`);
setPubspecVersion(`${args[0]}+${args[1]}`);
} else {
usage();
diff --git a/.github/workflows/app-release.yml b/.github/workflows/app-release.yml
index b850d0b1d8..b1d24c87ff 100644
--- a/.github/workflows/app-release.yml
+++ b/.github/workflows/app-release.yml
@@ -11,6 +11,7 @@ on:
type: choice
options:
- auth
+ - locker
- ensu
action:
description: "Release action"
@@ -68,6 +69,14 @@ jobs:
run: |
set -euo pipefail
+ app_version() {
+ if [ "${APP}" = "ensu" ]; then
+ node .github/scripts/ensu-version.mjs "$@"
+ else
+ node .github/scripts/flutter-version.mjs "${APP}" "$@"
+ fi
+ }
+
git_push_release_branch() {
git -c http.https://github.com/.extraheader= push \
"https://x-access-token:${RELEASE_BRANCH_PUSH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" "$@"
@@ -84,7 +93,7 @@ jobs:
fi
next_branch="${APP}-v${next_version}"
- main_version="$(node ".github/scripts/${APP}-version.mjs" get)"
+ main_version="$(app_version get)"
if [ "${main_version}" != "${expected_main_version}" ]; then
echo "::error::main is ${main_version}, expected ${expected_main_version}"
exit 1
@@ -92,7 +101,7 @@ jobs:
git switch -c "${release_branch}"
if [ "${APP}" = "ensu" ]; then
- node ".github/scripts/ensu-version.mjs" set "${VERSION}"
+ app_version set "${VERSION}"
git commit -am "${APP^} v${VERSION}"
fi
git_push_release_branch "${release_branch}"
@@ -101,7 +110,7 @@ jobs:
git push origin ":refs/tags/${beta_tag}" || true
git switch -c "${next_branch}" main
- node ".github/scripts/${APP}-version.mjs" set "${next_version}"
+ app_version set "${next_version}"
CHANGES_DIR="mobile/apps/${APP}/changes"
if [ "${APP}" = "ensu" ]; then
CHANGES_DIR="rust/apps/ensu/changes"
@@ -119,6 +128,14 @@ jobs:
run: |
set -euo pipefail
+ app_version() {
+ if [ "${APP}" = "ensu" ]; then
+ node .github/scripts/ensu-version.mjs "$@"
+ else
+ node .github/scripts/flutter-version.mjs "${APP}" "$@"
+ fi
+ }
+
git_push_release_branch() {
git -c http.https://github.com/.extraheader= push \
"https://x-access-token:${RELEASE_BRANCH_PUSH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" "$@"
@@ -133,7 +150,7 @@ jobs:
exit 1
fi
- branch_version="$(node ".github/scripts/${APP}-version.mjs" get)"
+ branch_version="$(app_version get)"
if [ "${branch_version}" != "${VERSION}" ]; then
echo "::error::${release_branch} is ${branch_version}, expected ${VERSION}"
exit 1
diff --git a/.github/workflows/auth-build.yml b/.github/workflows/auth-build.yml
index 2e2ff19378..3b172ebfe1 100644
--- a/.github/workflows/auth-build.yml
+++ b/.github/workflows/auth-build.yml
@@ -8,8 +8,8 @@ on:
- "release/auth-v*"
workflow_dispatch:
schedule:
- # Run every weekday at ~6:15 AM IST
- - cron: "45 0 * * 1-5"
+ # Run every weekday at ~5:15 AM IST
+ - cron: "45 23 * * 0-4"
env:
FLUTTER_VERSION: "3.38.10"
@@ -54,8 +54,8 @@ jobs:
exit 0
fi
- release_version="$(node .github/scripts/auth-version.mjs get)"
- build_number_base="$(node .github/scripts/auth-version.mjs get-build-base)"
+ release_version="$(node .github/scripts/flutter-version.mjs auth get)"
+ build_number_base="$(node .github/scripts/flutter-version.mjs auth get-build-base)"
build_number=$((build_number_base + GITHUB_RUN_NUMBER))
if [[ "${GITHUB_REF_NAME}" == release/auth-v* ]]; then
@@ -125,7 +125,7 @@ jobs:
working-directory: mobile/packages/strings
- name: Set build version
- run: node ../../../.github/scripts/auth-version.mjs set-build "${RELEASE_VERSION}" "${BUILD_NUMBER}"
+ run: node ../../../.github/scripts/flutter-version.mjs auth set-build "${RELEASE_VERSION}" "${BUILD_NUMBER}"
- name: Resolve dependencies with lockfile enforcement
run: flutter pub get --enforce-lockfile
@@ -234,7 +234,7 @@ jobs:
working-directory: mobile/packages/strings
- name: Set build version
- run: node ../../../.github/scripts/auth-version.mjs set-build "${RELEASE_VERSION}" "${BUILD_NUMBER}"
+ run: node ../../../.github/scripts/flutter-version.mjs auth set-build "${RELEASE_VERSION}" "${BUILD_NUMBER}"
- name: Resolve dependencies with lockfile enforcement
run: flutter pub get --enforce-lockfile
@@ -329,7 +329,7 @@ jobs:
working-directory: mobile/packages/strings
- name: Set build version
- run: node ../../../.github/scripts/auth-version.mjs set-build "${RELEASE_VERSION}" "${BUILD_NUMBER}"
+ run: node ../../../.github/scripts/flutter-version.mjs auth set-build "${RELEASE_VERSION}" "${BUILD_NUMBER}"
shell: bash
- name: Resolve dependencies with lockfile enforcement
@@ -458,7 +458,7 @@ jobs:
working-directory: mobile/packages/strings
- name: Set build version
- run: node ../../../.github/scripts/auth-version.mjs set-build "${RELEASE_VERSION}" "${BUILD_NUMBER}"
+ run: node ../../../.github/scripts/flutter-version.mjs auth set-build "${RELEASE_VERSION}" "${BUILD_NUMBER}"
- name: Resolve dependencies with lockfile enforcement
run: flutter pub get --enforce-lockfile
@@ -580,7 +580,7 @@ jobs:
working-directory: mobile/packages/strings
- name: Set build version
- run: node ../../../.github/scripts/auth-version.mjs set-build "${RELEASE_VERSION}" "${BUILD_NUMBER}"
+ run: node ../../../.github/scripts/flutter-version.mjs auth set-build "${RELEASE_VERSION}" "${BUILD_NUMBER}"
- name: Resolve dependencies with lockfile enforcement
run: flutter pub get --enforce-lockfile
diff --git a/.github/workflows/locker-build.yml b/.github/workflows/locker-build.yml
new file mode 100644
index 0000000000..a5fc3f6b90
--- /dev/null
+++ b/.github/workflows/locker-build.yml
@@ -0,0 +1,272 @@
+name: "Build (Locker)"
+
+# See .github/docs/app-release.md
+
+on:
+ push:
+ branches:
+ - "release/locker-v*"
+ workflow_dispatch:
+ schedule:
+ # Run every weekday at ~6:15 AM IST
+ - cron: "45 0 * * 1-5"
+
+env:
+ FLUTTER_VERSION: "3.38.10"
+
+permissions:
+ contents: write
+
+concurrency:
+ group: locker-build
+ cancel-in-progress: false
+
+jobs:
+ build-metadata:
+ runs-on: ubuntu-latest
+
+ outputs:
+ should_build: ${{ steps.prepare.outputs.should_build }}
+ commit_sha: ${{ steps.prepare.outputs.commit_sha }}
+ build_number: ${{ steps.prepare.outputs.build_number }}
+ release_version: ${{ steps.prepare.outputs.release_version }}
+ release_tag: ${{ steps.prepare.outputs.release_tag }}
+ release_title: ${{ steps.prepare.outputs.release_title }}
+ release_body: ${{ steps.prepare.outputs.release_body }}
+ release_body_grouped: ${{ steps.prepare.outputs.release_body_grouped }}
+ artifact_stem: ${{ steps.prepare.outputs.artifact_stem }}
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v6
+ with:
+ ref: ${{ github.ref_name }}
+
+ - name: Prepare release
+ id: prepare
+ shell: bash
+ run: |
+ set -euo pipefail
+
+ if [[ "${GITHUB_EVENT_NAME}" == "schedule" ]] && git ls-remote --exit-code --heads origin 'release/locker-v*' >/dev/null 2>&1; then
+ echo "Active Locker release branch found; skipping scheduled nightly"
+ echo "should_build=false" >> "${GITHUB_OUTPUT}"
+ exit 0
+ fi
+
+ release_version="$(node .github/scripts/flutter-version.mjs locker get)"
+ build_number_base="$(node .github/scripts/flutter-version.mjs locker get-build-base)"
+ build_number=$((build_number_base + GITHUB_RUN_NUMBER))
+
+ if [[ "${GITHUB_REF_NAME}" == release/locker-v* ]]; then
+ if [[ "${GITHUB_REF_NAME}" != "release/locker-v${release_version}" ]]; then
+ echo "::error::Branch ${GITHUB_REF_NAME} does not match Locker version ${release_version}"
+ exit 1
+ fi
+ release_tag="locker-v${release_version}-rc"
+ release_title="Locker release candidate - ${release_version} (build ${build_number})"
+ else
+ release_tag="locker-v${release_version}-beta"
+ release_title="Locker nightly - ${release_version} (build ${build_number})"
+ fi
+
+ commit_sha="$(git rev-parse HEAD)"
+ git fetch --force --depth=1 --no-tags origin "refs/tags/${release_tag}:refs/tags/${release_tag}" || true
+
+ echo "should_build=true" >> "${GITHUB_OUTPUT}"
+ echo "commit_sha=${commit_sha}" >> "${GITHUB_OUTPUT}"
+ echo "build_number=${build_number}" >> "${GITHUB_OUTPUT}"
+ echo "release_version=${release_version}" >> "${GITHUB_OUTPUT}"
+ echo "release_tag=${release_tag}" >> "${GITHUB_OUTPUT}"
+ echo "release_title=${release_title}" >> "${GITHUB_OUTPUT}"
+ echo "artifact_stem=ente-${release_tag%-rc}" >> "${GITHUB_OUTPUT}"
+ node .github/scripts/release-notes.mjs mobile/apps/locker/changes "${release_tag}" >> "${GITHUB_OUTPUT}"
+
+ build-android:
+ needs: build-metadata
+ if: needs.build-metadata.outputs.should_build == 'true'
+ runs-on: ubuntu-22.04
+ environment:
+ name: production
+ env:
+ COMMIT_SHA: ${{ needs.build-metadata.outputs.commit_sha }}
+ BUILD_NUMBER: ${{ needs.build-metadata.outputs.build_number }}
+ RELEASE_VERSION: ${{ needs.build-metadata.outputs.release_version }}
+ RELEASE_TAG: ${{ needs.build-metadata.outputs.release_tag }}
+ RELEASE_BODY: ${{ needs.build-metadata.outputs.release_body }}
+ ARTIFACT_STEM: ${{ needs.build-metadata.outputs.artifact_stem }}
+
+ defaults:
+ run:
+ working-directory: mobile/apps/locker
+
+ steps:
+ - name: Checkout code and submodules
+ uses: actions/checkout@v6
+ with:
+ ref: ${{ needs.build-metadata.outputs.commit_sha }}
+ submodules: recursive
+
+ - name: Setup JDK 17
+ uses: actions/setup-java@v5
+ with:
+ 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 }}
+ cache: true
+
+ - name: Generate strings localizations
+ run: flutter gen-l10n
+ working-directory: mobile/packages/strings
+
+ - name: Set build version
+ run: node ../../../.github/scripts/flutter-version.mjs locker set-build "${RELEASE_VERSION}" "${BUILD_NUMBER}"
+
+ - name: Resolve dependencies with lockfile enforcement
+ run: flutter pub get --enforce-lockfile
+
+ - run: cargo codegen frb
+ working-directory: rust
+
+ - name: Prepare whatsnew
+ run: |
+ mkdir -p whatsnew
+ if [ -n "${RELEASE_BODY}" ]; then
+ printf '%s' "${RELEASE_BODY}" | head -c 500 > whatsnew/whatsnew-en-US
+ else
+ printf '%s\n' "Bug fixes and improvements" > whatsnew/whatsnew-en-US
+ fi
+
+ - name: Add keystore
+ run: printf '%s' "${SIGNING_KEY_LOCKER}" | base64 -d > "$RUNNER_TEMP/ente_locker_key.jks"
+ env:
+ SIGNING_KEY_LOCKER: ${{ secrets.SIGNING_KEY_LOCKER }}
+
+ - name: Create artifacts directory
+ run: mkdir artifacts
+
+ - name: Build independent APK
+ run: |
+ flutter build apk --build-name="${RELEASE_VERSION}" --build-number="${BUILD_NUMBER}" --dart-define=cronetHttpNoPlay=true --release --flavor independent
+ mv build/app/outputs/flutter-apk/app-independent-release.apk "artifacts/${ARTIFACT_STEM}.apk"
+ env:
+ SIGNING_KEY_PATH: ${{ runner.temp }}/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: Build PlayStore AAB
+ run: flutter build appbundle --build-name="${RELEASE_VERSION}" --build-number="${BUILD_NUMBER}" --dart-define=cronetHttpNoPlay=true --release --flavor playstore
+ env:
+ SIGNING_KEY_PATH: ${{ runner.temp }}/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: Generate checksums
+ run: sha256sum artifacts/ente-locker-*.apk > artifacts/sha256sum-apk
+
+ - name: Upload checksum snippet
+ uses: actions/upload-artifact@v4
+ with:
+ name: locker-sha256sum-android
+ path: mobile/apps/locker/artifacts/sha256sum-apk
+
+ - name: Upload Android artifact to GitHub release
+ uses: ncipollo/release-action@339a81892b84b4eeb0f6e744e4574d79d0d9b8dd # v1.21.0
+ with:
+ tag: ${{ env.RELEASE_TAG }}
+ name: ${{ env.RELEASE_TAG }}
+ body: ${{ env.RELEASE_BODY }}
+ commit: ${{ env.COMMIT_SHA }}
+ artifacts: "mobile/apps/locker/artifacts/ente-locker-*.apk"
+ draft: true
+ allowUpdates: true
+ updateOnlyUnreleased: true
+
+ - name: Upload AAB to PlayStore
+ uses: r0adkll/upload-google-play@e738b9dd8f2476ea806d921b64aacd24f34515a5 # v1.1.5
+ with:
+ serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }}
+ packageName: io.ente.locker
+ releaseFiles: mobile/apps/locker/build/app/outputs/bundle/playstoreRelease/app-playstore-release.aab
+ tracks: internal
+ whatsNewDirectory: mobile/apps/locker/whatsnew
+ mappingFile: mobile/apps/locker/build/app/outputs/mapping/playstoreRelease/mapping.txt
+
+ finish-build:
+ needs: [build-metadata, build-android]
+ if: needs.build-metadata.outputs.should_build == 'true'
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout built commit
+ uses: actions/checkout@v6
+ with:
+ ref: ${{ needs.build-metadata.outputs.commit_sha }}
+
+ - name: Download checksum snippets
+ uses: actions/download-artifact@v4
+ with:
+ pattern: locker-sha256sum-*
+ path: checksums
+ merge-multiple: true
+
+ - name: Combine checksums
+ run: cat checksums/sha256sum-* > sha256sum
+
+ - name: Point release tag at the successfully built commit
+ env:
+ COMMIT_SHA: ${{ needs.build-metadata.outputs.commit_sha }}
+ RELEASE_TAG: ${{ needs.build-metadata.outputs.release_tag }}
+ run: |
+ git tag --force "${RELEASE_TAG}" "${COMMIT_SHA}"
+ git push --force origin "refs/tags/${RELEASE_TAG}"
+
+ - name: Upload checksum to GitHub release
+ env:
+ GH_TOKEN: ${{ github.token }}
+ RELEASE_TAG: ${{ needs.build-metadata.outputs.release_tag }}
+ run: gh release upload "${RELEASE_TAG}" sha256sum --clobber
+
+ - name: Notify Discord
+ continue-on-error: true
+ env:
+ DISCORD_WEBHOOK: ${{ secrets.DISCORD_INTERNAL_RELEASE_WEBHOOK }}
+ GH_TOKEN: ${{ github.token }}
+ RELEASE_BODY_GROUPED: ${{ needs.build-metadata.outputs.release_body_grouped }}
+ RELEASE_TAG: ${{ needs.build-metadata.outputs.release_tag }}
+ run: |
+ release_url="$(gh release view "${RELEASE_TAG}" --json url --jq .url)"
+ download_line="-# Download: [Play Store](https://play.google.com/store/apps/details?id=io.ente.locker) | [GitHub Release](${release_url})"
+ release_body_discord="$(awk '
+ /^Previous changes:$/ { previous = 1 }
+ previous && NF { print "-# " $0; next }
+ { print }
+ ' <<< "${RELEASE_BODY_GROUPED}")"
+ if [ "${#release_body_discord}" -gt 3000 ]; then
+ release_body_discord="${release_body_discord:0:3000}"$'\n\n...\n-# See the GitHub release for full notes.'
+ fi
+
+ jq -n \
+ --arg title "${{ needs.build-metadata.outputs.release_title }}" \
+ --arg body "${release_body_discord}" \
+ --arg download_line "${download_line}" \
+ '{
+ flags: 32768,
+ components: [{
+ type: 17,
+ accent_color: 8388736,
+ components: (
+ [{type: 10, content: ("## " + $title)}]
+ + (if $body == "" then [] else [{type: 10, content: $body}] end)
+ + [{type: 14}, {type: 10, content: $download_line}]
+ )
+ }]
+ }' \
+ | curl -fsSL -H 'Content-Type: application/json' -d @- "${DISCORD_WEBHOOK}?with_components=true"
diff --git a/.github/workflows/locker-internal-release.yml b/.github/workflows/locker-internal-release.yml
deleted file mode 100644
index ab7e25d63c..0000000000
--- a/.github/workflows/locker-internal-release.yml
+++ /dev/null
@@ -1,134 +0,0 @@
-name: "Internal release (locker mobile)"
-
-on:
- workflow_dispatch: # Allow manually running the action
-
-env:
- FLUTTER_VERSION: "3.38.10"
-
-permissions:
- contents: write
-
-jobs:
- build:
- runs-on: ubuntu-latest
-
- defaults:
- run:
- working-directory: mobile/apps/locker
-
- steps:
- - name: Checkout code
- uses: actions/checkout@v6
-
- - 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: Resolve dependencies with lockfile enforcement
- run: flutter pub get --enforce-lockfile
-
- - run: cargo codegen frb
- working-directory: rust
-
- - 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}"
-
- 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"
-
- if [ -f "$CHANGELOG_FILE" ]; then
- head -c 500 "$CHANGELOG_FILE" > "$OUTPUT_FILE"
- else
- echo "Bug fixes and improvements" > "$OUTPUT_FILE"
- fi
-
- if [ ! -s "$OUTPUT_FILE" ]; then
- echo "Changelog is empty."
- exit 1
- fi
-
- LENGTH=$(wc -m < "$OUTPUT_FILE")
- if [ "$LENGTH" -gt 500 ]; then
- echo "Changelog exceeds 500 characters ($LENGTH)."
- exit 1
- fi
-
- echo "Validated Play Store changelog:"
- cat "$OUTPUT_FILE"
-
- CHANGELOG_PLAYSTORE=$(cat "$OUTPUT_FILE" | sed ':a;N;$!ba;s/\n/\\n/g' | sed 's/"/\\"/g')
- echo "CHANGELOG=${CHANGELOG_PLAYSTORE}" >> $GITHUB_ENV
-
- if [ -f "$DISCORD_FILE" ]; then
- CHANGELOG_DISCORD=$(cat "$DISCORD_FILE" | sed 's/"/\\"/g')
- else
- CHANGELOG_DISCORD=$(cat "$OUTPUT_FILE" | sed 's/"/\\"/g')
- fi
- echo "CHANGELOG_DISCORD<<EOF" >> $GITHUB_ENV
- echo "$CHANGELOG_DISCORD" >> $GITHUB_ENV
- echo "EOF" >> $GITHUB_ENV
-
- - name: Add keystore
- run: echo "${{ secrets.SIGNING_KEY_LOCKER }}" | base64 -d > "$RUNNER_TEMP/ente_locker_key.jks"
-
- - name: Build PlayStore AAB
- run: |
- flutter build appbundle --dart-define=cronetHttpNoPlay=true --release --flavor playstore
- env:
- SIGNING_KEY_PATH: ${{ runner.temp }}/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: Upload AAB to PlayStore
- uses: r0adkll/upload-google-play@v1
- with:
- serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }}
- packageName: io.ente.locker
- releaseFiles: mobile/apps/locker/build/app/outputs/bundle/playstoreRelease/app-playstore-release.aab
- track: internal
- whatsNewDirectory: mobile/apps/locker/whatsnew
- mappingFile: mobile/apps/locker/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: "πŸ”’ Internal release available for Locker v${{ env.NEW_VERSION }}"
- 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.locker)
- **Changes:**
- ${{ env.CHANGELOG_DISCORD }}
- color: 0x4CAF50
diff --git a/.github/workflows/locker-lint.yml b/.github/workflows/locker-lint.yml
index 51f0c275e4..1733e58ab4 100644
--- a/.github/workflows/locker-lint.yml
+++ b/.github/workflows/locker-lint.yml
@@ -24,7 +24,7 @@ permissions:
jobs:
locker-lint:
- runs-on: ubuntu-latest
+ runs-on: macos-26
defaults:
run:
working-directory: mobile/apps/locker
@@ -59,6 +59,10 @@ jobs:
- run: flutter pub get --enforce-lockfile
+ - name: Check iOS Podfile.lock is current
+ run: pod install --deployment
+ working-directory: mobile/apps/locker/ios
+
- name: Generate locker localizations
run: flutter gen-l10n
diff --git a/.github/workflows/locker-release.yml b/.github/workflows/locker-release.yml
deleted file mode 100644
index b167f9f441..0000000000
--- a/.github/workflows/locker-release.yml
+++ /dev/null
@@ -1,103 +0,0 @@
-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.38.10"
-
-permissions:
- contents: write
-
-jobs:
- build:
- runs-on: ubuntu-latest
-
- defaults:
- run:
- working-directory: mobile/apps/locker
-
- steps:
- - name: Checkout code
- uses: actions/checkout@v6
-
- - 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: Resolve dependencies with lockfile enforcement
- run: flutter pub get --enforce-lockfile
-
- - run: cargo codegen frb
- working-directory: rust
-
- - name: Add keystore
- run: echo "${{ secrets.SIGNING_KEY_LOCKER }}" | base64 -d > "$RUNNER_TEMP/ente_locker_key.jks"
-
- - 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: ${{ runner.temp }}/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
diff --git a/mobile/apps/auth/README.md b/mobile/apps/auth/README.md
index e9200b2e29..16888bba67 100644
--- a/mobile/apps/auth/README.md
+++ b/mobile/apps/auth/README.md
@@ -41,7 +41,7 @@ You can view your 2FA codes at [auth.ente.com](https://auth.ente.com). For addin
3. Install dependencies using one of these methods:
- **Using Melos (recommended):** Install Melos with `dart pub global activate melos`, then from any folder inside `mobile/`, run `melos bootstrap`. This will install dependencies.
- - **Using Flutter directly:** Run `flutter pub get --enforce-lockfile` in `packages/strings` and this folder
+ - **Using Flutter directly:** Run `flutter pub get --enforce-lockfile` in `packages/strings` and this folder.
4. Run the app:
- Android: `flutter run --flavor independent`
diff --git a/mobile/apps/locker/README.md b/mobile/apps/locker/README.md
index 88fd9b6bf8..dd8f9e4198 100644
--- a/mobile/apps/locker/README.md
+++ b/mobile/apps/locker/README.md
@@ -8,7 +8,7 @@ Ente's secure document storage app. An end-to-end encrypted app for storing impo
2. Install dependencies using one of these methods:
- **Using Melos (recommended):** Install Melos with `dart pub global activate melos`, then from any folder inside `mobile/`, run `melos bootstrap`. This will install dependencies.
- - **Using Flutter directly:** Run `flutter pub get` in `packages/strings` and this folder
+ - **Using Flutter directly:** Run `flutter pub get --enforce-lockfile` in `packages/strings` and this folder.
3. Run the app:
- Android: `flutter run --flavor independent`
@@ -16,6 +16,10 @@ Ente's secure document storage app. An end-to-end encrypted app for storing impo
To build a release APK, [setup your keystore](https://docs.flutter.dev/deployment/android#create-an-upload-keystore) and run `flutter build apk --release --flavor independent`. For iOS, use `flutter build ios`.
+### Updating dependencies
+
+After updating Flutter dependencies, run `pod install` from `ios/` on macOS and commit `ios/Podfile.lock` if it changes.
+
## 🌍 Translate
[![Crowdin](https://badges.crowdin.net/ente-locker/localized.svg)](https://crowdin.com/project/ente-locker)
diff --git a/mobile/apps/locker/changes/README.md b/mobile/apps/locker/changes/README.md
new file mode 100644
index 0000000000..bff6242785
--- /dev/null
+++ b/mobile/apps/locker/changes/README.md
@@ -0,0 +1,7 @@
+For each user facing change, create a new `arbitrary-slug.md`, e.g.:
+
+```md
+- Added support for importing documents from another app.
+```
+
+All these files are concatenated in alphabetical order for the release notes.
diff --git a/mobile/apps/locker/pubspec.yaml b/mobile/apps/locker/pubspec.yaml
index 7e41ca2caf..d213d3c053 100644
--- a/mobile/apps/locker/pubspec.yaml
+++ b/mobile/apps/locker/pubspec.yaml
@@ -1,7 +1,7 @@
name: locker
description: "Ente Locker – Safe space for your important documents"
publish_to: "none"
-version: 1.0.4+104
+version: 1.0.5+182
environment:
sdk: ">=3.10.0 <4.0.0"
diff --git a/mobile/apps/locker/scripts/internal_changes.txt b/mobile/apps/locker/scripts/internal_changes.txt
deleted file mode 100644
index d194ab0785..0000000000
--- a/mobile/apps/locker/scripts/internal_changes.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-Latest changes:
-- Bug fixes and improvements
diff --git a/mobile/apps/locker/scripts/store_changes.txt b/mobile/apps/locker/scripts/store_changes.txt
deleted file mode 100644
index 9b93f0911e..0000000000
--- a/mobile/apps/locker/scripts/store_changes.txt
+++ /dev/null
@@ -1 +0,0 @@
-Bug fixes and improvements