-
Notifications
You must be signed in to change notification settings - Fork 243
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7be5856
commit 4652ce5
Showing
1 changed file
with
22 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |