+ {{ page.date | date: '%d-%B-%Y' }} +
+
+
|
+
+
|
+
From 6024e475124c7df38581b9cb8d34182854718dc6 Mon Sep 17 00:00:00 2001 From: ryannathans <2804894-ryannathans@users.noreply.gitlab.com> Date: Wed, 26 Jan 2022 23:05:02 +1100 Subject: [PATCH] automated update releases --- make-release.py | 172 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 172 insertions(+) create mode 100755 make-release.py diff --git a/make-release.py b/make-release.py new file mode 100755 index 000000000..b9855d3c7 --- /dev/null +++ b/make-release.py @@ -0,0 +1,172 @@ +#!/usr/bin/env python3 + +import subprocess +import datetime +import os + + +WEB_REPO = '../2009scape.github.io' +NEWS_DIR = 'services/m=news/archives' +LOG_DELIMITER = ';;;;;' +DEBUG = False + + +class Tag: + def __init__(self, tag_name, last_tag): + self.tag_name = tag_name + self.last_tag = last_tag + + +def make_tag() -> Tag: + tag_name = datetime.datetime.now().strftime('%b-%d-%Y') + print('new release tag:', tag_name) + last_tag = subprocess.check_output(['git', 'describe', '--tags', '--abbrev=0']).decode('utf8').strip() + print('last release tag:', last_tag) + if not DEBUG: + subprocess.run(['git', 'tag', tag_name]) + return Tag(tag_name, last_tag) + + +def get_changelog_html(tag: Tag) -> str: + if DEBUG: + log_period = f'{tag.last_tag}..HEAD' + else: + log_period = f'{tag.last_tag}..{tag.tag_name}' + changelog = subprocess.check_output(['git', 'log', log_period, f'--format=%B{LOG_DELIMITER}']).decode('utf8').split(LOG_DELIMITER) + changelog_html = ''.join(['
+
|
+
+
|
+