From 8d8455898cec73b414b4ba3b9aae5e8ae2a52d6f Mon Sep 17 00:00:00 2001 From: drewcassidy Date: Fri, 16 Apr 2021 22:24:44 -0700 Subject: [PATCH] Version 0.1.1 --- .github/workflows/python-publish.yml | 36 ++++++++++++++++++++++++++++ CHANGELOG.md | 10 ++++++++ README.md | 2 +- yaclog_ksp/__main__.py | 23 +++++++++++------- 4 files changed, 61 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/python-publish.yml diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml new file mode 100644 index 0000000..1ccb277 --- /dev/null +++ b/.github/workflows/python-publish.yml @@ -0,0 +1,36 @@ +# This workflow will upload a Python Package using Twine when a release is created +# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries + +name: Upload Python Package +on: + release: + types: [ published ] + +jobs: + deploy: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel twine + + - name: Install pypa/build + run: python -m pip install build --user + + - name: Build a binary wheel and source tarball + run: python -m build --sdist --wheel --outdir dist/ + + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/CHANGELOG.md b/CHANGELOG.md index f835a1f..39516c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,19 @@ # Changelog + All notable changes to this project will be documented in this file +## 0.1.1 - 2021-04-16 + +yaclog-ksp is [now available on PyPi!](https://pypi.org/project/yaclog-ksp/) + +### Changed + +- generator will now use change values instead of nodes when possible for more concise output files. + ## 0.1.0 - 2021-04-16 First release ### Added + - `yaclog-ksp` command line tool for converting markdown changelogs to KerbalChangelog configs diff --git a/README.md b/README.md index 47e1ac0..da7a05e 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ A command line tool for converting markdown changelogs to [KerbalChangelog] conf ## Installation -run `pip install git+https://github.com/drewcassidy/yaclog-ksp.git` +run `pip install yaclog-ksp` ## Usage diff --git a/yaclog_ksp/__main__.py b/yaclog_ksp/__main__.py index 720ae6b..938474e 100644 --- a/yaclog_ksp/__main__.py +++ b/yaclog_ksp/__main__.py @@ -64,12 +64,6 @@ def main(inpath, outpath, name): # add entries for section, entries in version.sections.items(): for entry in entries: - e_node = v_node.add_new_node('CHANGE') - - if section: - # KerbalChangelog only actually cares about the first character, - # so dont bother correcting "Fixed"->"Fix", etc - e_node.add_value('type', section.title()) bullets = re.findall(r'^[\t ]*[-+*] (.*?)$', entry, flags=re.MULTILINE) @@ -82,9 +76,20 @@ def main(inpath, outpath, name): change = bullets[0] subchanges = bullets[1:] - e_node.add_value('change', change) - for sc in subchanges: - e_node.add_value('subchange', sc) + if section or len(subchanges) > 0: + e_node = v_node.add_new_node('CHANGE') + + if section: + # KerbalChangelog only actually cares about the first character, + # so dont bother correcting "Fixed"->"Fix", etc + e_node.add_value('type', section.title()) + + e_node.add_value('change', change) + for sc in subchanges: + e_node.add_value('subchange', sc) + + else: + v_node.add_value('change', change) with open(outpath, 'w') as fp: fp.write('KERBALCHANGELOG\n')