Compare commits

...

10 Commits

Author SHA1 Message Date
9a8d3a608b Fix deployment 2024-08-27 01:16:59 -07:00
f8ba353560 Release Version 1.0.3
### Changed

- Adjusted dependencies. Click <8 is no longer supported
- When stdout is not a tty, only the output file path is printed

### Added

- Added Github Action
2024-08-26 23:52:01 -07:00
17acf53a87 Require compatible with yaclog 1.0.0
I might change the API someday
2024-08-26 23:51:43 -07:00
40bff2ac00 PEP621ify things 2024-08-26 23:49:11 -07:00
553ed836bb
Merge pull request #3 from drewcassidy/dependabot/github_actions/actions/checkout-4
Bump actions/checkout from 2 to 4
2024-08-26 23:43:35 -07:00
dependabot[bot]
c534acd525
Bump actions/checkout from 2 to 4
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-27 06:42:51 +00:00
b8b8c82d09 Add action.yaml 2024-08-26 23:42:21 -07:00
dffcea2994 Start running dependabot 2024-08-26 23:42:12 -07:00
be3e5e4325 Setup trusted environment deployment 2024-08-26 23:40:54 -07:00
a96073cb67 print outpath only when not writing to a tty 2024-08-26 21:50:00 -07:00
7 changed files with 138 additions and 67 deletions

8
.github/dependabot.yml vendored Normal file
View File

@ -0,0 +1,8 @@
# Set update schedule for GitHub Actions
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every week
interval: "weekly"

View File

@ -1,49 +1,47 @@
# 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: build
on: [ push, pull_request ]
name: Deploy
on: [ push ]
jobs:
deploy:
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
environment:
name: pypi
url: https://pypi.org/p/yaclog-ksp
permissions:
id-token: write
contents: write
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5.1.1
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install setuptools wheel twine
python -m pip install yaclog
python-version: '>=3.8'
- name: Install pypa/build
run: python -m pip install build --user
- name: Build a binary wheel and source tarball
- name: Build a Binary Wheel and Source Tarball
run: python -m build --sdist --wheel --outdir dist/
- name: Get version name and body
run: |
echo "VERSION_TILE=$(yaclog show -n)" >> $GITHUB_ENV
echo "$(yaclog show -mb)" >> RELEASE.md
- name: Get Changelog Information
uses: drewcassidy/yaclog@1.4.2
id: yaclog-show
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Publish to Github
uses: softprops/action-gh-release@v1
with:
files: dist/*
name: ${{ env.VERSION_TITLE }}
body_path: RELEASE.md
run: |
gh release create ${{ github.ref_name }} \
--notes-file "${{ steps.yaclog-show.outputs.body_file }}" \
--title "${{ steps.yaclog-show.outputs.name }}"
gh release upload ${{ github.ref_name }} dist/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ github.token }}

View File

@ -2,6 +2,18 @@
All notable changes to this project will be documented in this file.
## Version 1.0.3 - 2024-08-27
### Changed
- Adjusted dependencies. Click <8 is no longer supported
- When stdout is not a tty, only the output file path is printed
### Added
- Added Github Action
## Version 1.0.2 - 2021-05-12
### Changed

43
action.yaml Normal file
View File

@ -0,0 +1,43 @@
name: Generate KSP Changelog
description: >
Use Yaclog to generate a KSP changelog config file for use with KerbalChangelog
branding:
icon: file-text
color: green
inputs:
changelog-path:
description: "Path of the changelog markdown file"
mod-name:
description: "The name of your mod"
output-path:
description: "Path of the resulting changelog file"
outputs:
output-path:
description: "Path of the resulting changelog file"
value: ${{ steps.yaclog-ksp.outputs.output-path}}
runs:
using: "composite"
steps:
- id: setup-python
uses: actions/setup-python@v5
with:
python-version: '3.12'
update-environment: 'false'
- name: Setup Yaclog-KSP
shell: bash
run: pipx install --python ${{ steps.setup-python.outputs.python-path }} ${{ github.action_path }}
- name: Generate KSP Changelog
id: yaclog-ksp
shell: bash
run: >
cat "output-path=$(
yaclog-ksp
${{ inputs.changelog-path && format('--path {0}', inputs.changelog-path) }}
${{ inputs.mod-name && format('--name {0}', inputs.mod-name) }}
${{ inputs.output-path && format('--output {0}', inputs.output-path) }}
)" >> "$GITHUB_OUTPUT"

View File

@ -1,9 +1,53 @@
[build-system]
requires = [
"setuptools >= 35.0.2",
"setuptools_scm[toml] >= 3.4",
"setuptools>=64",
"setuptools_scm>=8",
"wheel"
]
build-backend = "setuptools.build_meta"
[tool.setuptools_scm]
[project]
name = "yaclog-ksp"
description = "Kerbal Space Program changelog file generator"
readme = "README.md"
authors = [{ name = "Andrew Cassidy", email = "drewcassidy@me.com" }]
keywords = ["changelog", "commandline", "markdown", "KSP"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU Affero General Public License v3",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Text Processing :: Markup :: Markdown",
"Topic :: Software Development :: Version Control :: Git",
"Topic :: Utilities",
"Topic :: Games/Entertainment :: Simulation"
]
requires-python = ">= 3.8"
dependencies = [
"Click >= 8.0",
"yaclog ~= 1.0"
]
dynamic = ["version"]
[project.scripts]
yaclog-ksp = "yaclog_ksp.__main__:main"
[project.urls]
Source = "https://github.com/drewcassidy/yaclog-ksp"
Changelog = "https://github.com/drewcassidy/yaclog-ksp/blob/main/CHANGELOG.md"
"Forum Post" = "https://forum.kerbalspaceprogram.com/index.php?/topic/201784-*"
[tool.setuptools_scm]
fallback_version = '0.0.0'
[tool.setuptools.packages.find]
include = ["yaclog_ksp"]

View File

@ -1,39 +0,0 @@
[metadata]
# until setuptools supports PEP621, this will have to do
name = yaclog-ksp
description = Kerbal Space Program changelog file generator
author = Andrew Cassidy
license = AGPLv3
license_file = LICENSE.md
long_description = file: README.md
long_description_content_type = text/markdown
keywords = changelog, commandline, markdown, KSP
classifiers =
Development Status :: 5 - Production/Stable
Intended Audience :: Developers
License :: OSI Approved :: GNU Affero General Public License v3
Operating System :: OS Independent
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Topic :: Games/Entertainment :: Simulation
Topic :: Text Processing :: Markup :: Markdown
Topic :: Utilities
project_urls =
Changelog = https://github.com/drewcassidy/yaclog-ksp/blob/main/CHANGELOG.md
Source = https://github.com/drewcassidy/yaclog-ksp
Forum Post = https://forum.kerbalspaceprogram.com/index.php?/topic/201784-*
[options]
install_requires =
Click >= 7.0, < 9.0
yaclog ~= 1.0
python_requires = >= 3.8
packages = find:
[options.entry_points]
console_scripts =
yaclog-ksp = yaclog_ksp.__main__:main

View File

@ -16,6 +16,8 @@
import pathlib
import re
from sys import stdout
import click
import yaclog
@ -111,7 +113,10 @@ def main(path, outpath, name):
fp.write('KERBALCHANGELOG\n')
fp.write(str(node))
print(f'wrote output to {outpath}')
if stdout.isatty():
print(f'wrote output to {outpath}')
else:
print(outpath)
if __name__ == '__main__':