From 6133c6f0b5ab64513dcb0c395277232411a70848 Mon Sep 17 00:00:00 2001 From: Terry Geng Date: Wed, 8 Jul 2020 09:50:50 +0800 Subject: [PATCH] chore: Parse changelog in markdown into html when publishing release. --- .drone.yml | 4 ++-- mumbleBot.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.drone.yml b/.drone.yml index 07e03ce2..da54c2bf 100644 --- a/.drone.yml +++ b/.drone.yml @@ -53,14 +53,14 @@ steps: - name: deploy-stable image: debian commands: - - apt-get -qq update && apt-get -qq install jq curl git > /dev/null + - apt-get -qq update && apt-get -qq install jq curl git pandoc > /dev/null - sed -i 's/target_version = git/target_version = stable/' configuration.default.ini - git fetch --tags - version=$(git describe --abbrev=0 --tags) - echo "version is $version" - echo $version > /mnt/botamusique/version - sed -i "s/version = 'git'/version = '$version'/" mumbleBot.py - - curl --silent "https://api.github.com/repos/azlux/botamusique/releases/latest" | jq -r '.body' > /mnt/botamusique/changelog + - curl --silent "https://api.github.com/repos/azlux/botamusique/releases/latest" | jq -r '.body' | pandoc --from gfm --to html - --output - > /mnt/botamusique/changelog - rm -rf .git* - rm -rf web - mkdir /tmp/botamusique diff --git a/mumbleBot.py b/mumbleBot.py index 1d2d0511..8908741a 100644 --- a/mumbleBot.py +++ b/mumbleBot.py @@ -178,7 +178,7 @@ def __init__(self, args): last_startup_version = var.db.get("bot", "version", fallback=None) if not last_startup_version or version.parse(last_startup_version) < version.parse(self.version): var.db.set("bot", "version", self.version) - changelog = util.fetch_changelog().replace("\n", "
") + changelog = util.fetch_changelog() self.send_channel_msg(constants.strings("update_successful", version=self.version, changelog=changelog)) # Set the CTRL+C shortcut