From b3587a7aeafac917d1599e5bcfd30d0921693bcd Mon Sep 17 00:00:00 2001 From: Distopico Vegan Date: Thu, 6 Dec 2018 02:31:50 -0500 Subject: [PATCH] chore(ci): generate changelogs metadata on release --- .gitlab-ci.yml | 2 ++ .releaserc.yml | 4 ++-- metadata/en-US/changelogs/114.txt | 4 ++++ scripts/prepare.sh | 14 ++++++++++++-- 4 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 metadata/en-US/changelogs/114.txt diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e259445b..5b63d138 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -18,6 +18,7 @@ cache: - .gradle/ before_script: + - apt-get update -qq && apt-get install -y -qq pandoc wget # Get sdk version from project - export ANDROID_COMPILE_SDK=`egrep '^[[:blank:]]+compileSdkVersion' app/build.gradle | awk '{print $2}'` # Explict output for logging purpose only @@ -94,6 +95,7 @@ release: only: - master before_script: + - apt-get update -qq && apt-get install -y -qq pandoc wget - wget --quiet --output-document=/tmp/nvm-install.sh https://raw.githubusercontent.com/creationix/nvm/v0.33.6/install.sh - bash /tmp/nvm-install.sh - export NVM_DIR="$HOME/.nvm" &&. "$NVM_DIR/nvm.sh" && nvm install 8 diff --git a/.releaserc.yml b/.releaserc.yml index 0e5acc46..a3a0c5f8 100644 --- a/.releaserc.yml +++ b/.releaserc.yml @@ -4,11 +4,11 @@ plugins: - - "@semantic-release/changelog" - changelogTitle: |- # Change Log - + All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. - - "@semantic-release/exec" - - prepareCmd: './scripts/prepare.sh ${nextRelease.version}' + - prepareCmd: './scripts/prepare.sh ${nextRelease.version} ${nextRelease.notes}' - - "@semantic-release/git" - assets: - CHANGELOG.md diff --git a/metadata/en-US/changelogs/114.txt b/metadata/en-US/changelogs/114.txt new file mode 100644 index 00000000..ea8e8b7e --- /dev/null +++ b/metadata/en-US/changelogs/114.txt @@ -0,0 +1,4 @@ +Bug Fixes + +- check compatibility on notification settings +- crash on public notification without color diff --git a/scripts/prepare.sh b/scripts/prepare.sh index 3438d517..b967dcb6 100755 --- a/scripts/prepare.sh +++ b/scripts/prepare.sh @@ -1,5 +1,15 @@ #!/bin/sh +# Update version FILE="app/build.gradle" -VERSIONCODE=`grep "versionCode .*" $FILE | sed "s/versionCode //"` -sed -i "s/versionCode .*$/versionCode $(($VERSIONCODE + 1))/; s/versionName .*$/versionName \"$1\"/" $FILE +CODE=`grep "versionCode .*" $FILE | sed "s/versionCode //"` +VERSIONCODE=$(($CODE + 1)) +sed -i "s/versionCode .*$/versionCode $VERSIONCODE/; s/versionName .*$/versionName \"$1\"/" $FILE + +# Save change-log +CHNAGELOG="metadata/en-US/changelogs/$VERSIONCODE.txt" +echo -e "$2" > "$CHNAGELOG" +pandoc -f markdown -t plain --wrap=none "$CHNAGELOG" -o "$CHNAGELOG" +tail -n +3 "$CHNAGELOG" > "$CHNAGELOG.tmp" && mv "$CHNAGELOG.tmp" "$CHNAGELOG" +sed -i "s/ \((.*)\)//" "$CHNAGELOG" +# marked -i "$CHNAGELOG" -o "$CHNAGELOG" --sanitize