From acd822d6d1d95d5fdf3b647437a216bafd36ead5 Mon Sep 17 00:00:00 2001 From: wereturtle Date: Sat, 18 Jun 2022 15:01:50 -0700 Subject: [PATCH] configure CI --- .release-it.json | 28 +++++++++++++++++----------- appveyor.yml | 4 ++-- releaseNotes.py | 31 +++++++++++++++++++++++++++++++ 3 files changed, 50 insertions(+), 13 deletions(-) create mode 100755 releaseNotes.py diff --git a/.release-it.json b/.release-it.json index d1c8eace2..6243d79d5 100644 --- a/.release-it.json +++ b/.release-it.json @@ -2,11 +2,10 @@ "hooks": {}, "git": { "changelog": null, - "requireCleanWorkingDir": true, - "requireBranch": false, + "requireCleanWorkingDir": false, "requireUpstream": true, - "requireCommits": false, - "addUntrackedFiles": false, + "requireCommits": true, + "addUntrackedFiles": true, "commit": true, "commitMessage": "Release ${version}", "commitArgs": [], @@ -16,20 +15,22 @@ "tagArgs": [], "push": true, "pushArgs": ["--follow-tags"], - "pushRepo": "" + "pushRepo": "", + "requireBranch": "master" }, "github": { - "release": false, - "releaseName": "Release ${version}", - "releaseNotes": null, + "release": true, + "releaseName": "ghostwriter ${version}", + "releaseNotes": "./releaseNotes.py ${version}", "preRelease": false, - "draft": false, + "draft": true, "tokenRef": "GITHUB_TOKEN", - "assets": null, + "assets": ["COPYING", "CHANGELOG.md"], "host": null, "timeout": 0, "proxy": null, - "skipChecks": false + "skipChecks": false, + "web": true }, "plugins": { "@j-ulrich/release-it-regex-bumper": { @@ -75,6 +76,11 @@ "file": "appveyor.yml", "search": "appver:.*", "replace": "appver: {{version}}" + }, + { + "file": "CHANGELOG.md", + "search": "\\[Unreleased\\].*", + "replace": "[{{version}}] - {{now:YYYY-MM-DD}}" } ] } diff --git a/appveyor.yml b/appveyor.yml index 7d0136000..3f3662823 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -44,10 +44,10 @@ artifacts: deploy: tag: $(appver) release: $(APPVEYOR_PROJECT_NAME) $(appver) - draft: true + draft: false provider: GitHub auth_token: - secure: BwAh7GBWfGp5VD1+HS20if8Y0QWVHM5ldypiUtDACIt3eVpEdaNvqCfao5ZIMD2C + secure: B+un2fzPlu2vLk0lPKh+QkcpVEU5xGc/g4sRFCXnaKp5b1CpQeYKE8xZmJRMXf6l artifact: $(portable_dir).zip force_update: true on: diff --git a/releaseNotes.py b/releaseNotes.py new file mode 100755 index 000000000..d3e16a7bc --- /dev/null +++ b/releaseNotes.py @@ -0,0 +1,31 @@ +#!/bin/python + +import sys + +if len(sys.argv) != 2: + print("Missing or invalid arguments.") + print("Please provide release version number.") + exit(1) + +version = sys.argv[1] + +changelog = open('CHANGELOG.md', 'r') +lines = changelog.readlines() + +currentRelease = False + +print("## Release Notes") + +for line in lines: + if not currentRelease and line.startswith("## ["): + currentRelease = True + elif currentRelease: + if line.startswith("## ["): + break # All done! + else: + print(line.rstrip()) + +print("## Downloads") +print("") +print(r'[![ubuntu](https://img.shields.io/static/v1?label=&color=purple&logo=ubuntu&message=Ubuntu&style=for-the-badge)](https://launchpad.net/~wereturtle/+archive/ubuntu/ppa) [![fedora](https://img.shields.io/static/v1?label=&color=blue&logo=fedora&message=Fedora&style=for-the-badge)](https://copr.fedorainfracloud.org/coprs/wereturtle/stable/) [![Windows](https://img.shields.io/static/v1?label=&color=blue&logo=windows&message=Windows&style=for-the-badge)](https://github.com/wereturtle/ghostwriter/releases/download/' + version + r'/ghostwriter_' + version + r'_win64_portable.zip)') +