6
0
mirror of https://github.com/ChristianLight/tutor.git synced 2024-11-13 00:36:30 +00:00

ci: better github release management with scriv

In scriv 1.1.0 the GitHub release description can be templated:
https://github.com/nedbat/scriv/issues/61
https://github.com/nedbat/scriv/releases/tag/1.1.0

This means that we can finally get rid of our ugly scripts to generate the
release description \o/
This commit is contained in:
Régis Behmo 2023-01-17 11:58:39 +01:00 committed by Régis Behmo
parent b903c69fac
commit 8f2df6a842
7 changed files with 36 additions and 38 deletions

View File

@ -70,16 +70,9 @@ jobs:
##### Create release on GitHub
- name: Create or update GitHub release
# I wish there was an `--update` option to the `gh release create` command, but
# there isn't.
# https://cli.github.com/manual/gh_release_create
run: |
make release-description | tee release_description.md
export GH_ARGS="${{ github.ref_name }} --notes-file=release_description.md"
echo "gh args: '$GH_ARGS'"
${{ env.gh_bin }} release create $GH_ARGS || ${{ env.gh_bin }} release edit $GH_ARGS
run: scriv github-release
env:
GH_TOKEN: ${{ github.token }}
GITHUB_TOKEN: ${{ github.token }}
- name: Upload release asset to GitHub
run: |
export FILENAME="tutor-$(uname -s)_$(uname -m)"

View File

@ -54,12 +54,11 @@ format: ## Format code automatically
isort: ## Sort imports. This target is not mandatory because the output may be incompatible with black formatting. Provided for convenience purposes.
isort --skip=templates ${SRC_DIRS}
bootstrap-dev: ## Install dev requirements
pip install .
pip install -r requirements/dev.txt
changelog-entry: ## Create a new changelog entry
scriv create
bootstrap-dev-plugins: bootstrap-dev ## Install dev requirements and all supported plugins
pip install -r requirements/plugins.txt
changelog: ## Collect changelog entries in the CHANGELOG.md file
scriv collect
###### Code coverage
@ -78,23 +77,17 @@ coverage-html: coverage-report ## Generate HTML report for the code coverage
coverage-browse-report: coverage-html ## Open the HTML report in the browser
sensible-browser htmlcov/index.html
###### Deployment
###### Continuous integration tasks
bundle: ## Bundle the tutor package in a single "dist/tutor" executable
pyinstaller tutor.spec
bootstrap-dev: ## Install dev requirements
pip install .
pip install -r requirements/dev.txt
changelog-entry: ## Create a new changelog entry
scriv create
changelog: ## Collect changelog entries in the CHANGELOG.md file
scriv collect
release-description: ## Write the current release description to a file
@sed "s/TUTOR_VERSION/v$(shell make version)/g" docs/_release_description.md
@git log -1 --pretty=format:%b
###### Continuous integration tasks
bootstrap-dev-plugins: bootstrap-dev ## Install dev requirements and all supported plugins
pip install -r requirements/plugins.txt
pull-base-images: # Manually pull base images
docker image pull docker.io/ubuntu:20.04

View File

@ -3,5 +3,6 @@ version = literal: tutor/__about__.py: __version__
categories =
format = md
md_header_level = 2
new_fragment_template = file: scriv/new_fragment.${config:format}.j2
entry_title_template = file: scriv/entry_title.${config:format}.j2
new_fragment_template = file: changelog.d/scriv/new_fragment.${config:format}.j2
entry_title_template = file: changelog.d/scriv/entry_title.${config:format}.j2
ghrel_template = file: changelog.d/scriv/github_release.${config:format}.j2

View File

@ -1,13 +1,14 @@
Install this version from pip with:
pip install "tutor[full]==TUTOR_VERSION"
pip install "tutor[full]=={{ version }}"
Or download the compiled binaries:
sudo curl -L "https://github.com/overhangio/tutor/releases/download/TUTOR_VERSION/tutor-$(uname -s)_$(uname -m)" -o /usr/local/bin/tutor
sudo curl -L "https://github.com/overhangio/tutor/releases/download/{{ version }}/tutor-$(uname -s)_$(uname -m)" -o /usr/local/bin/tutor
sudo chmod 0755 /usr/local/bin/tutor
See the [installation docs](https://docs.tutor.overhang.io/install.html) for more installation options and instructions.
## Changes
{{ body }}

View File

@ -1,6 +1,6 @@
#
# This file is autogenerated by pip-compile with python 3.10
# To update, run:
# This file is autogenerated by pip-compile with Python 3.8
# by the following command:
#
# pip-compile requirements/base.in
#
@ -62,7 +62,9 @@ six==1.16.0
tomli==2.0.1
# via mypy
typing-extensions==4.4.0
# via mypy
# via
# -r requirements/base.in
# mypy
urllib3==1.26.13
# via
# kubernetes

View File

@ -1,6 +1,6 @@
#
# This file is autogenerated by pip-compile with python 3.10
# To update, run:
# This file is autogenerated by pip-compile with Python 3.8
# by the following command:
#
# pip-compile requirements/dev.in
#
@ -172,7 +172,7 @@ rsa==4.9
# via
# -r requirements/base.txt
# google-auth
scriv==1.0.0
scriv==1.1.0
# via -r requirements/dev.in
secretstorage==3.3.3
# via keyring
@ -204,7 +204,11 @@ types-setuptools==65.6.0.2
typing-extensions==4.4.0
# via
# -r requirements/base.txt
# astroid
# black
# mypy
# pylint
# rich
urllib3==1.26.13
# via
# -r requirements/base.txt

View File

@ -1,6 +1,6 @@
#
# This file is autogenerated by pip-compile with python 3.10
# To update, run:
# This file is autogenerated by pip-compile with Python 3.8
# by the following command:
#
# pip-compile requirements/docs.in
#
@ -42,6 +42,8 @@ idna==3.4
# requests
imagesize==1.4.1
# via sphinx
importlib-metadata==6.0.0
# via sphinx
jinja2==3.1.2
# via
# -r requirements/base.txt
@ -147,6 +149,8 @@ websocket-client==1.4.2
# via
# -r requirements/base.txt
# kubernetes
zipp==3.11.0
# via importlib-metadata
# The following packages are considered to be unsafe in a requirements file:
# setuptools