Browse Source

chore(ci): generate changelogs metadata on release

main
Distopico Vegan 6 years ago
parent
commit
b3587a7aea
4 changed files with 20 additions and 4 deletions
  1. +2
    -0
      .gitlab-ci.yml
  2. +2
    -2
      .releaserc.yml
  3. +4
    -0
      metadata/en-US/changelogs/114.txt
  4. +12
    -2
      scripts/prepare.sh

+ 2
- 0
.gitlab-ci.yml View File

@ -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


+ 2
- 2
.releaserc.yml View File

@ -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


+ 4
- 0
metadata/en-US/changelogs/114.txt View File

@ -0,0 +1,4 @@
Bug Fixes
- check compatibility on notification settings
- crash on public notification without color

+ 12
- 2
scripts/prepare.sh View File

@ -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

Loading…
Cancel
Save