Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,10 @@ jobs:
env:
GH_TOKEN: ${{ github.token }}
run: |
version_code="$(sed -nE 's/^[[:space:]]*versionCode = ([0-9]+)/\1/p' app/build.gradle.kts)"
notes="$RUNNER_TEMP/release-notes.md"
en="fastlane/metadata/android/en-US/changelogs/$version_code.txt"
ru="fastlane/metadata/android/ru-RU/changelogs/$version_code.txt"
test -s "$en" && test -s "$ru"
{ printf '## English\n\n'; cat "$en"; printf '\n## Русский\n\n'; cat "$ru"; } > "$notes"
committed_notes="release-notes/${GITHUB_REF_NAME#v}.md"
test -s "$committed_notes"
cp "$committed_notes" "$notes"
cd dist/release
sha256sum -c SHA256SUMS
gh release create "$GITHUB_REF_NAME" ./*.apk mapping.txt SHA256SUMS \
Expand Down
34 changes: 27 additions & 7 deletions docs/en/release-automation.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,37 @@ Leaving the field empty runs normal CI. Local equivalent from a clean checkout:

## Behavior and recovery

Generation sends commit messages and diff statistics since the highest stable `vX.Y.Z` tag
reachable from the selected `main` commit to OpenAI, not source code or signing secrets.
History over 100,000 characters, API errors, refusals and invalid responses stop before file writes.
Generation compares against the highest reachable published stable `vX.Y.Z` release with
nonempty uploaded `message487.apk`, `message487-X.Y.Z.apk`, `mapping.txt` and `SHA256SUMS` assets.
Bare tags, drafts, prereleases and incomplete releases are skipped. Commit messages (excluding
merges) and the actual net diff are sent to OpenAI; historical changelogs, generated release
notes and lock/sum files are excluded. Context over 600,000 characters fails without truncation.
API errors, refusals and invalid responses stop before file writes; length errors retry up to
three attempts. Returned model, Git range and token usage are logged without credentials.
[Structured Outputs](https://developers.openai.com/api/docs/guides/structured-outputs) validates
format, not factual accuracy; notes remain visible in the PR.
format, not factual accuracy; review the generated notes in the PR.

The `release/vX.Y.Z` commit changes only `versionName`, `versionCode` incremented by one, and two
new `fastlane/metadata/android/{en-US,ru-RU}/changelogs/<versionCode>.txt` files, each 1–500 characters.
Historical notes remain unchanged. GitHub Release uses the same texts. You choose the version;
Notes use concise bullets with one sentence per change, describing concrete behavior supported
by the diff. Maintenance-only releases name the maintenance work and state that app behavior
is unchanged. GitHub gets up to 10 bullets and 3,000 characters per locale; F-Droid gets a
separate summary of up to 500 characters per locale.

The `release/vX.Y.Z` commit changes only `versionName`, `versionCode` incremented by one, two
new `fastlane/metadata/android/{en-US,ru-RU}/changelogs/<versionCode>.txt` files, and bilingual
`release-notes/X.Y.Z.md`. Finalization validates both formats; GitHub publication uses the
committed Markdown. Historical notes remain unchanged. You choose the version;
prereleases are unsupported.

Preview an existing release without writing files or publishing:

```sh
GITHUB_REPOSITORY=andre487/AndroidMessage487 bundle exec fastlane android release_notes_preview version:0.0.6 ref:v0.0.6
```

Set `OPENAI_API_KEY`, `OPENAI_RELEASE_MODEL` and authenticate `gh` first. This is a billed API
request. The explicit `ref` excludes later commits; use `previous:v0.0.5` only to override
automatic baseline selection. Both GitHub and F-Droid notes print to stdout.

Finalize waits up to 60 minutes for successful full CI for that PR, head SHA and comparison base.
Both API 26/35 emulator jobs must succeed, including on version-only release PRs.
Skipped/neutral/missing emulator jobs are not success. Changed PRs or an advanced `main` stop merge. The merged
Expand Down
42 changes: 31 additions & 11 deletions docs/ru/release-automation.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,37 @@

## Что делает автоматизация

Из истории после максимального стабильного тега `vX.Y.Z`, достижимого из выбранного
коммита `main`, в OpenAI отправляются сообщения коммитов и статистика diff.
Исходный код и signing-секреты не отправляются. При истории больше 100 000 символов,
ошибке API, отказе модели или некорректном ответе процесс останавливается до записи файлов.
Используется [Structured Outputs](https://developers.openai.com/api/docs/guides/structured-outputs);
формат ответа не гарантирует правильность текста, поэтому changelog доступен в PR.

В `release/vX.Y.Z` меняются только `versionName`, увеличенный на единицу `versionCode`
и два новых файла `fastlane/metadata/android/{en-US,ru-RU}/changelogs/<versionCode>.txt`
по 1–500 символов. Исторические записи не переписываются. GitHub Release использует
эти же тексты. Номер версии задаёте вы; prerelease не поддерживается.
База сравнения — максимальный стабильный опубликованный `vX.Y.Z`, достижимый из выбранного
коммита, с непустыми загруженными `message487.apk`, `message487-X.Y.Z.apk`, `mapping.txt`
и `SHA256SUMS`. Голые теги, черновики, prerelease и неполные релизы пропускаются.
В OpenAI отправляются сообщения коммитов без merge и фактический итоговый diff, кроме
исторических changelog, сгенерированных release notes и lock/sum-файлов.
Контекст больше 600 000 символов останавливает процесс без усечения. Ошибки API, отказ модели
и некорректный ответ останавливают процесс до записи файлов; при превышении длины текста
доступно до трёх попыток. В лог выводятся фактическая модель, диапазон Git и расход токенов
без ключей. [Structured Outputs](https://developers.openai.com/api/docs/guides/structured-outputs)
проверяет формат, но не достоверность — проверьте текст в PR.

Тексты состоят из коротких пунктов: одно предложение на изменение, конкретное поведение
из diff. Если изменена только инфраструктура, текст называет эти изменения и сообщает,
что поведение приложения не изменилось. Для GitHub — до 10 пунктов и 3000 символов на язык,
для F-Droid — отдельная выжимка до 500 символов на язык.

В `release/vX.Y.Z` меняются только `versionName`, увеличенный на единицу `versionCode`,
два новых файла `fastlane/metadata/android/{en-US,ru-RU}/changelogs/<versionCode>.txt`
и двуязычный `release-notes/X.Y.Z.md`. Finalize проверяет оба формата; публикация GitHub
использует сохранённый Markdown. Исторические записи не переписываются.
Номер версии задаёте вы; prerelease не поддерживается.

Предпросмотр существующего релиза без записи файлов и публикации:

```sh
GITHUB_REPOSITORY=andre487/AndroidMessage487 bundle exec fastlane android release_notes_preview version:0.0.6 ref:v0.0.6
```

Заранее задайте `OPENAI_API_KEY`, `OPENAI_RELEASE_MODEL` и авторизуйте `gh`. Запрос платный.
Явный `ref` исключает более поздние коммиты; `previous:v0.0.5` позволяет переопределить
автоматический выбор базы. В stdout выводятся тексты GitHub и F-Droid.

Finalize ждёт до 60 минут успешного CI именно этого PR, head SHA и базы сравнения.
Оба эмуляторных job API 26/35 обязательны и для release PR, меняющего только версию.
Expand Down
9 changes: 9 additions & 0 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,15 @@ platform :android do
end
end

desc "Preview EN/RU GitHub and F-Droid notes without writing release files"
lane :release_notes_preview do |options|
arguments = ["preview", "--version", options.fetch(:version).to_s, "--ref", options.fetch(:ref).to_s]
arguments += ["--previous", options[:previous].to_s] if options[:previous]
Dir.chdir(project_root) do
sh(ENV.fetch("PYTHON", "python3"), "scripts/release_automation.py", *arguments)
end
end

desc "Require full release PR CI, squash merge, and tag its verified merged commit"
lane :release_finish do |options|
version = options[:version] || ENV.fetch("RELEASE_VERSION")
Expand Down
8 changes: 8 additions & 0 deletions fastlane/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@ Build, sign and verify release APK and checksums

Generate EN/RU changelogs, bump the version, and create a release PR

### android release_notes_preview

```sh
[bundle exec] fastlane android release_notes_preview
```

Preview EN/RU GitHub and F-Droid notes without writing release files

### android release_finish

```sh
Expand Down
Loading
Loading