Skip to content

Commit de75594

Browse files
authored
Fixing changelog script. (#1844)
1 parent 163ec9a commit de75594

File tree

1 file changed

+22
-6
lines changed

1 file changed

+22
-6
lines changed

scripts/generate_changelog.sh

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,30 @@
22
set -e
33

44
pushd ../
5+
# Creating the new tag and version code
6+
new_tag="$1"
7+
new_version_code="$2"
8+
github_token="$3"
59

10+
# Replacing the versions in the app/build.gradle.kts
11+
app_build_gradle="app/build.gradle.kts"
12+
sed -i "s/versionCode = .*/versionCode = $new_version_code/" $app_build_gradle
13+
sed -i "s/versionName = .*/versionName = \"$new_tag\"/" $app_build_gradle
614

7-
# Creating the new tag
8-
new_tag="$1"
15+
# Writing to the Releases.md asset that's loaded inside the app, and the fastlane changelog
16+
tmp_file="tmp_release.md"
17+
fastlane_file="fastlane/metadata/android/en-US/changelogs/$new_version_code.txt"
18+
assets_releases="app/src/main/assets/RELEASES.md"
19+
git cliff --unreleased --tag "$new_tag" --output $tmp_file --github-token "$github_token"
20+
prettier -w $tmp_file
921

10-
# Writing to the Releases.md asset that's loaded inside the app
11-
git cliff --unreleased --tag "$new_tag" --output app/src/main/assets/RELEASES.md
22+
cp $tmp_file $assets_releases
23+
cp $tmp_file $fastlane_file
24+
rm $tmp_file
1225

13-
# Prepending to the RELEASES.md
26+
# Adding to RELEASES.md
1427
git cliff --tag "$new_tag" --output RELEASES.md
15-
prettier -w RELEASES.md app/src/main/assets/RELEASES.md
28+
prettier -w RELEASES.md
29+
30+
# Add them all to git
31+
git add $assets_releases $fastlane_file $app_build_gradle RELEASES.md

0 commit comments

Comments
 (0)