Skip to content

Commit

Permalink
Adding fastlane generation. (#1219)
Browse files Browse the repository at this point in the history
  • Loading branch information
dessalines authored Jan 1, 2025
1 parent 7be5856 commit 4652ce5
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions generate_changelog.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,29 @@
#!/bin/sh
set -e

# Creating the new tag
# Creating the new tag and version code
new_tag="$1"
new_version_code="$2"

# Writing to the Releases.md asset that's loaded inside the app
git cliff --unreleased --tag "$new_tag" --output app/src/main/assets/RELEASES.md
# Replacing the versions in the app/build.gradle.kts
app_build_gradle="app/build.gradle.kts"
sed -i "s/versionCode = .*/versionCode = $new_version_code/" $app_build_gradle
sed -i "s/versionName = .*/versionName = \"$new_tag\"/" $app_build_gradle

# Prepending to the RELEASES.md
# Writing to the Releases.md asset that's loaded inside the app, and the fastlane changelog
tmp_file="tmp_release.md"
fastlane_file="fastlane/metadata/android/en-US/changelogs/$new_version_code.txt"
assets_releases="app/src/main/assets/RELEASES.md"
git cliff --unreleased --tag "$new_tag" --output $tmp_file
prettier -w $tmp_file

cp $tmp_file $assets_releases
cp $tmp_file $fastlane_file
rm $tmp_file

# Adding to RELEASES.md
git cliff --tag "$new_tag" --output RELEASES.md
prettier -w RELEASES.md app/src/main/assets/RELEASES.md
prettier -w RELEASES.md

# Add them all to git
git add $assets_releases $fastlane_file $app_build_gradle RELEASES.md

0 comments on commit 4652ce5

Please sign in to comment.