# Update the changelog and news(optionally), bump the version, and create a release
#
# The release is created on the given branch, release and tag name format will be <version>-<branch> and
# the body of the release will be created from the changelog.txt or news element in the addon.xml.in
#
# options:
# - version_type: 'minor' / 'micro' # whether to do a minor or micro version bump
# - changelog_text: string to add to the changelog and news
# - update_news: 'true' / 'false' # whether to update the news in the addon.xml.in
# - add_date: 'true' / 'false' # Add date to version number in changelog and news. ie. v1.0.1 (2021-7-17)
on:
workflow_dispatch:
inputs:
version_type:
description:'Create a ''minor'' or ''micro'' release?'
required:true
default:'minor'
changelog_text:
description:'Input the changes you''d like to add to the changelogs. Your text should be encapsulated in "''s with line feeds represented by literal \n''s. ie. "This is the first change\nThis is the second change"'
required:true
default:''
update_news:
description:'Update news in addon.xml.in? [true|false]'
required:true
default:'true'
add_date:
description:'Add date to version number in changelog and news. ie. "v1.0.1 (2021-7-17)" [true|false]'
required:true
default:'false'
jobs:
default:
runs-on:ubuntu-latest
name:Changelog and Release
steps:
# Checkout the current repository into a directory (repositories name)
- name:Checkout Repository
uses:actions/checkout@v2
with:
fetch-depth:0
path:${{ github.event.repository.name }}
# Checkout the required scripts from kodi-pvr/pvr-scripts into the 'scripts' directory
- name:Checkout Scripts
uses:actions/checkout@v2
with:
fetch-depth:0
repository:kodi-pvr/pvr-scripts
path:scripts
# Install all dependencies required by the following steps
# - libxml2-utils, xmlstarlet: reading news and version from addon.xml.in
- name:Install dependencies
run:|
sudo apt-get install libxml2-utils xmlstarlet
# Setup python version 3.9
- name:Set up Python
uses:actions/setup-python@v2
with:
python-version:'3.9'
# Run the python script to increment the version, changelog and news
- name:Increment version and update changelogs
run:|
arguments=
if [[ ${{ github.event.inputs.update_news }} == true ]] ;