diff --git a/Makefile b/Makefile index 92fc08f2be..32fd825b95 100644 --- a/Makefile +++ b/Makefile @@ -602,6 +602,14 @@ changelog-chrome: sh -c "cat new-CHANGELOG.md ee/fleetd-chrome/CHANGELOG.md > tmp-CHANGELOG.md && rm new-CHANGELOG.md && mv tmp-CHANGELOG.md ee/fleetd-chrome/CHANGELOG.md" sh -c "git rm ee/fleetd-chrome/changes/*" +changelog-android: + $(eval TODAY_DATE := $(shell date "+%b %d, %Y")) + @echo -e "## Android agent $(version) ($(TODAY_DATE))\n" > new-CHANGELOG.md + sh -c "find android/changes -type f ! -name .keep -exec awk 'NF' {} + | sed -E 's/^-/*/' >> new-CHANGELOG.md" + @echo "" >> new-CHANGELOG.md + sh -c "cat new-CHANGELOG.md android/CHANGELOG.md > tmp-CHANGELOG.md && rm new-CHANGELOG.md && mv tmp-CHANGELOG.md android/CHANGELOG.md" + sh -c "find android/changes -type f ! -name .keep -exec git rm {} +" + # Updates the documentation for the currently released versions of fleetd components in old Fleet's TUF (tuf.fleetctl.com). fleetd-old-tuf: sh -c 'echo "\n# tuf.fleetctl.com\n\nFollowing are the currently deployed versions of fleetd components on the \`stable\` and \`edge\` channel.\n" > orbit/old-TUF.md' diff --git a/android/RELEASE.md b/android/RELEASE.md index bfad871479..aa4b3e13e6 100644 --- a/android/RELEASE.md +++ b/android/RELEASE.md @@ -25,12 +25,20 @@ defaultConfig { ## 3. Update CHANGELOG.md -Add an entry for the new version with changes since the last release. +From the repo root, run the changelog generator to pull entries from `android/changes/`: + +```bash +make changelog-android version=1.X.X +``` + +This collects all entries from `android/changes/`, prepends them to `android/CHANGELOG.md` with a dated header, and stages the change files for deletion. + +Review the generated changelog and manually add any additional entries that are not covered by the `android/changes/` directory. ## 4. Commit and push RC branch ```bash -git add app/build.gradle.kts CHANGELOG.md +git add android/app/build.gradle.kts android/CHANGELOG.md android/changes/ git commit -m "Prepare release v1.X.X" git push origin rc-minor-fleetd-android-v1.X.X ``` @@ -127,10 +135,11 @@ git checkout main git pull origin main git checkout -b bring-fleetd-android-v1.X.X-to-main git checkout rc-minor-fleetd-android-v1.X.X -- android/app/build.gradle.kts android/CHANGELOG.md +git diff --name-only --diff-filter=D main...rc-minor-fleetd-android-v1.X.X -- android/changes/ | xargs git rm --ignore-unmatch git commit -m "Update version and CHANGELOG for fleetd-android-v1.X.X" git push origin bring-fleetd-android-v1.X.X-to-main ``` Then open a PR to merge `bring-fleetd-android-v1.X.X-to-main` into `main`. -This brings only the version bump and CHANGELOG updates to main, not other RC changes. +This brings the version bump and CHANGELOG updates to main and removes only the changelog entries that were processed in the RC, preserving any new entries added to main after the RC branch was cut.