Skip to content

armgit / ente

Public Imported from GitHub
0

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

Share app release process

Manav Rathi42a5e2a16b43
diff --git a/.github/docs/ensu-release.md b/.github/docs/app-release.md
similarity index 71%
rename from .github/docs/ensu-release.md
rename to .github/docs/app-release.md
index 4b88e2a4eb..47b32cfa08 100644
--- a/.github/docs/ensu-release.md
+++ b/.github/docs/app-release.md
@@ -1,6 +1,10 @@
-# Ensu release process
+# App release process
-> The following assumes main is `0.1.16-beta`, we want to release `0.1.16` and move main to `0.1.17-beta`.
+Auth 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.
## Normal development
@@ -15,8 +19,9 @@ Nightly builds of `main` are automatically created every weekday morning (IST),
## Start release
```sh
-gh workflow run ensu-release.yml \
+gh workflow run app-release.yml \
-f action=start \
+ -f app=ensu \
-f version=0.1.16
```
@@ -41,8 +46,9 @@ git push
## Promote release
```sh
-gh workflow run ensu-release.yml \
+gh workflow run app-release.yml \
-f action=promote \
+ -f app=ensu \
-f version=0.1.16
```
@@ -62,4 +68,4 @@ Publish the draft ensu-v0.1.16 release on GitHub when ready.
>
> If a build has already reached Play Store or TestFlight, trigger a new workflow run instead of re-running failed jobs so that it gets a new build number.
-`ensu-release.yml` changes release state. If it fails, inspect the failed step before re-running. After it has pushed a branch, created a tag, or moved a draft release, either finish the remaining step manually or undo the partial state first. Cleanup is intentionally late: `action=start` pushes the release branch before deleting the beta draft, and `action=promote` deletes the release branch last.
+`app-release.yml` changes release state. If it fails, inspect the failed step before re-running. After it has pushed a branch, created a tag, or moved a draft release, either finish the remaining step manually or undo the partial state first. Cleanup is intentionally late: `action=start` pushes the release branch before deleting the beta draft, and `action=promote` deletes the release branch last.
diff --git a/.github/scripts/auth-version.mjs b/.github/scripts/auth-version.mjs
new file mode 100644
index 0000000000..ea6cc7faa0
--- /dev/null
+++ b/.github/scripts/auth-version.mjs
@@ -0,0 +1,64 @@
+#!/usr/bin/env node
+
+import fs from "node:fs";
+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");
+
+function read() {
+ return fs.readFileSync(pubspec, "utf8");
+}
+
+function write(text) {
+ fs.writeFileSync(pubspec, text);
+}
+
+function pubspecVersion() {
+ const match = read().match(/^version:\s*(\d+\.\d+\.\d+)\+(\d+)$/m);
+ if (!match) throw new Error("Invalid Auth pubspec version");
+ return { source: match[1], buildBase: match[2] };
+}
+
+function setPubspecVersion(version) {
+ const text = read();
+ let count = 0;
+ const next = text.replace(/^version:\s*\S+/m, () => {
+ count += 1;
+ return `version: ${version}`;
+ });
+ if (!count) throw new Error("No version field found in mobile/apps/auth/pubspec.yaml");
+ 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 878`);
+}
+
+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]}`);
+ 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]}`);
+ setPubspecVersion(`${args[0]}+${args[1]}`);
+ } else {
+ usage();
+ process.exit(2);
+ }
+} catch (error) {
+ console.error(error.message);
+ process.exit(1);
+}
diff --git a/.github/workflows/ensu-release.yml b/.github/workflows/app-release.yml
similarity index 68%
rename from .github/workflows/ensu-release.yml
rename to .github/workflows/app-release.yml
index 5e9bf357a3..b850d0b1d8 100644
--- a/.github/workflows/ensu-release.yml
+++ b/.github/workflows/app-release.yml
@@ -1,10 +1,17 @@
-name: "Release (ensu)"
+name: "Release app"
-# See .github/docs/ensu-release.md
+# See .github/docs/app-release.md
on:
workflow_dispatch:
inputs:
+ app:
+ description: "App to release"
+ required: true
+ type: choice
+ options:
+ - auth
+ - ensu
action:
description: "Release action"
required: true
@@ -22,7 +29,7 @@ permissions:
pull-requests: write
concurrency:
- group: ensu-release
+ group: ${{ inputs.app }}-release
cancel-in-progress: false
jobs:
@@ -31,6 +38,7 @@ jobs:
environment:
name: release-branch-push
env:
+ APP: ${{ inputs.app }}
GH_TOKEN: ${{ github.token }}
VERSION: ${{ inputs.version }}
@@ -45,7 +53,7 @@ jobs:
if: inputs.action == 'promote'
uses: actions/checkout@v6
with:
- ref: release/ensu-v${{ inputs.version }}
+ ref: release/${{ inputs.app }}-v${{ inputs.version }}
- name: Configure Git
if: inputs.action == 'start'
@@ -65,33 +73,44 @@ jobs:
"https://x-access-token:${RELEASE_BRANCH_PUSH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" "$@"
}
- release_branch="release/ensu-v${VERSION}"
- beta_tag="ensu-v${VERSION}-beta"
+ release_branch="release/${APP}-v${VERSION}"
+ beta_tag="${APP}-v${VERSION}-beta"
IFS=. read -r major minor patch <<< "${VERSION}"
- next_version="${major}.${minor}.$((patch + 1))-beta"
- next_branch="ensu-v${next_version}"
+ expected_main_version="${VERSION}"
+ next_version="${major}.${minor}.$((patch + 1))"
+ if [ "${APP}" = "ensu" ]; then
+ expected_main_version="${VERSION}-beta"
+ next_version="${next_version}-beta"
+ fi
+ next_branch="${APP}-v${next_version}"
- main_version="$(node .github/scripts/ensu-version.mjs get)"
- if [ "${main_version}" != "${VERSION}-beta" ]; then
- echo "::error::main is ${main_version}, expected ${VERSION}-beta"
+ main_version="$(node ".github/scripts/${APP}-version.mjs" get)"
+ if [ "${main_version}" != "${expected_main_version}" ]; then
+ echo "::error::main is ${main_version}, expected ${expected_main_version}"
exit 1
fi
git switch -c "${release_branch}"
- node .github/scripts/ensu-version.mjs set "${VERSION}"
- git commit -am "Ensu v${VERSION}"
+ if [ "${APP}" = "ensu" ]; then
+ node ".github/scripts/ensu-version.mjs" set "${VERSION}"
+ git commit -am "${APP^} v${VERSION}"
+ fi
git_push_release_branch "${release_branch}"
gh release delete "${beta_tag}" --yes || true
git push origin ":refs/tags/${beta_tag}" || true
git switch -c "${next_branch}" main
- node .github/scripts/ensu-version.mjs set "${next_version}"
- find rust/apps/ensu/changes -maxdepth 1 -type f -name '*.md' ! -name README.md -delete
- git commit -am "Start Ensu ${next_version}"
+ node ".github/scripts/${APP}-version.mjs" set "${next_version}"
+ CHANGES_DIR="mobile/apps/${APP}/changes"
+ if [ "${APP}" = "ensu" ]; then
+ CHANGES_DIR="rust/apps/ensu/changes"
+ fi
+ find "${CHANGES_DIR}" -maxdepth 1 -type f -name '*.md' ! -name README.md -delete
+ git commit -am "Start ${APP^} ${next_version}"
git push -u origin "${next_branch}"
- gh pr create --base main --head "${next_branch}" --title "[ensu] Start Ensu ${next_version}" --body ""
+ gh pr create --base main --head "${next_branch}" --title "[${APP}] Start ${APP^} ${next_version}" --body ""
- name: Promote release
if: inputs.action == 'promote'
@@ -105,16 +124,16 @@ jobs:
"https://x-access-token:${RELEASE_BRANCH_PUSH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" "$@"
}
- release_branch="release/ensu-v${VERSION}"
- rc_tag="ensu-v${VERSION}-rc"
- final_tag="ensu-v${VERSION}"
+ release_branch="release/${APP}-v${VERSION}"
+ rc_tag="${APP}-v${VERSION}-rc"
+ final_tag="${APP}-v${VERSION}"
if ! rc_is_draft="$(gh release view "${rc_tag}" --json isDraft --jq .isDraft 2>/dev/null)" || [ "${rc_is_draft}" != "true" ]; then
echo "::error::${rc_tag} draft release does not exist"
exit 1
fi
- branch_version="$(node .github/scripts/ensu-version.mjs get)"
+ branch_version="$(node ".github/scripts/${APP}-version.mjs" get)"
if [ "${branch_version}" != "${VERSION}" ]; then
echo "::error::${release_branch} is ${branch_version}, expected ${VERSION}"
exit 1
diff --git a/.github/workflows/ensu-build.yml b/.github/workflows/ensu-build.yml
index 1a13e67da4..0f0ed3008d 100644
--- a/.github/workflows/ensu-build.yml
+++ b/.github/workflows/ensu-build.yml
@@ -1,6 +1,6 @@
name: "Build (Ensu)"
-# See .github/docs/ensu-release.md
+# See .github/docs/app-release.md
on:
push:
diff --git a/mobile/apps/auth/scripts/internal_changes.txt b/mobile/apps/auth/changes/01-current.md
similarity index 90%
rename from mobile/apps/auth/scripts/internal_changes.txt
rename to mobile/apps/auth/changes/01-current.md
index c86470ad67..79e5ac7641 100644
--- a/mobile/apps/auth/scripts/internal_changes.txt
+++ b/mobile/apps/auth/changes/01-current.md
@@ -1,3 +1,9 @@
+- App icon picker to customize your home screen appearance
+- New QR code dialog with branded design for sharing codes
+- Import 2FA codes from andOTP encrypted backups
+- Enhanced search and copy with keyboard shortcuts on desktop (press '/' to search, Enter to select, 'C' to copy, 'N' for next code)
+- Refreshed empty home screen when no codes are imported
+- Bug fixes and performance improvements
- Upgraded Auth to Flutter 3.38.10 and Android target SDK 36
- Worked around Android search and app-lock password autofocus not reliably opening the keyboard on app start ([#279](https://github.com/ente-io/ente/issues/279), [#10614](https://github.com/ente-io/ente/issues/10614))
- Made overflowing Auth tag strips scrollable with desktop mouse wheel and drag interactions, and made tag chips reachable by keyboard Tab and selectable with Enter or Space ([#4079](https://github.com/ente-io/ente/issues/4079), [#1811](https://github.com/ente-io/ente/issues/1811), [#1929](https://github.com/ente-io/ente/issues/1929), [#4686](https://github.com/ente-io/ente/issues/4686))
diff --git a/mobile/apps/auth/changes/README.md b/mobile/apps/auth/changes/README.md
new file mode 100644
index 0000000000..13270ce622
--- /dev/null
+++ b/mobile/apps/auth/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 2FA codes from another app.
+```
+
+All these files are concatenated in alphabetical order for the release notes.
diff --git a/mobile/apps/auth/scripts/store_changes.txt b/mobile/apps/auth/scripts/store_changes.txt
deleted file mode 100644
index 87f17089d8..0000000000
--- a/mobile/apps/auth/scripts/store_changes.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-- App icon picker to customize your home screen appearance
-- New QR code dialog with branded design for sharing codes
-- Import 2FA codes from andOTP encrypted backups
-- Enhanced search and copy with keyboard shortcuts on desktop (press '/' to search, Enter to select, 'C' to copy, 'N' for next code)
-- Refreshed empty home screen when no codes are imported
-- Bug fixes and performance improvements
\ No newline at end of file
diff --git a/rust/apps/ensu/changes/README.md b/rust/apps/ensu/changes/README.md
index d904c93a67..bd878340b3 100644
--- a/rust/apps/ensu/changes/README.md
+++ b/rust/apps/ensu/changes/README.md
@@ -1,4 +1,4 @@
-For each user facing change, create a new `01-arbitrary-slug.md`, e.g.:
+For each user facing change, create a new `arbitrary-slug.md`, e.g.:
```md
- Added support for switching model endpoints.