mirror of
https://github.com/drewcassidy/yaclog.git
synced 2024-09-01 14:58:58 +00:00
Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
4626e25838 | |||
5373cb9b48 | |||
e3fc69d305 | |||
d61208b583 | |||
2a39c69700 | |||
7a8b3c7160 |
15
.github/workflows/python-publish.yml
vendored
15
.github/workflows/python-publish.yml
vendored
@ -47,6 +47,11 @@ jobs:
|
|||||||
needs: test
|
needs: test
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
|
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
|
||||||
|
environment:
|
||||||
|
name: pypi
|
||||||
|
url: https://pypi.org/p/yaclog
|
||||||
|
permissions:
|
||||||
|
id-token: write
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
@ -56,25 +61,19 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
python-version: '>=3.8'
|
python-version: '>=3.8'
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
|
||||||
python -m pip install --upgrade pip
|
|
||||||
python -m pip install setuptools wheel twine
|
|
||||||
|
|
||||||
- name: Install pypa/build
|
- name: Install pypa/build
|
||||||
run: python -m pip install build --user
|
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/
|
run: python -m build --sdist --wheel --outdir dist/
|
||||||
|
|
||||||
- name: Get version info
|
- name: Get Changelog Information
|
||||||
id: yaclog-show
|
id: yaclog-show
|
||||||
uses: ./
|
uses: ./
|
||||||
|
# self-hosting!
|
||||||
|
|
||||||
- name: Publish to PyPI
|
- name: Publish to PyPI
|
||||||
uses: pypa/gh-action-pypi-publish@release/v1
|
uses: pypa/gh-action-pypi-publish@release/v1
|
||||||
with:
|
|
||||||
password: ${{ secrets.PYPI_API_TOKEN }}
|
|
||||||
|
|
||||||
- name: Publish to Github
|
- name: Publish to Github
|
||||||
run: |
|
run: |
|
||||||
|
36
CHANGELOG.md
36
CHANGELOG.md
@ -2,38 +2,60 @@
|
|||||||
|
|
||||||
All notable changes to this project will be documented in this file
|
All notable changes to this project will be documented in this file
|
||||||
|
|
||||||
|
## Version 1.4.2 - 2024-08-27
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Fixed package failing to install without git history
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Added the ability to specify the changelog path in the action
|
||||||
|
|
||||||
|
|
||||||
|
## Version 1.4.1 - 2024-08-25
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Fixed escape characters being included in github actions body file
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Added pypi tags for python 3.11 and 3.12
|
||||||
|
|
||||||
|
|
||||||
## Version 1.4.0 - 2024-08-25
|
## Version 1.4.0 - 2024-08-25
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
||||||
- added a github action to the repository. The action can create new releases and fetch version information. For mor information see the "Github Actions" page in the handbook
|
- Added a github action to the repository. The action can create new releases and fetch version information. For more information see the "Github Actions" page in the handbook
|
||||||
|
|
||||||
|
|
||||||
## Version 1.3.0 - 2024-08-08
|
## Version 1.3.0 - 2024-08-08
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
||||||
- added a `--version` option to `yaclog show` that prints just the version number
|
- Added a `--version` option to `yaclog show` that prints just the version number
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
- removed support for Click 7 as a dependency
|
- Removed support for Click 7 as a dependency
|
||||||
|
|
||||||
|
|
||||||
## Version 1.2.0 - 2024-04-16
|
## Version 1.2.0 - 2024-04-16
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
||||||
- added the `-s` option to `yaclog release` to increment arbitrary version segments
|
- Added the `-s` option to `yaclog release` to increment arbitrary version segments
|
||||||
- added the `-n` option to `yaclog release` to create a new release instead of releasing a new one
|
- Added the `-n` option to `yaclog release` to create a new release instead of releasing a new one
|
||||||
- added the `-y` option to `yaclog release` to answer "yes" to all confirmation dialogs. Use with caution!
|
- Added the `-y` option to `yaclog release` to answer "yes" to all confirmation dialogs. Use with caution!
|
||||||
|
|
||||||
|
|
||||||
## Version 1.1.2 - 2022-12-29
|
## Version 1.1.2 - 2022-12-29
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
- yaclog now only tries to use git when invoked with a command that needs it, meaning most sub commands can now be used on systems without git
|
- Yaclog now only tries to use git when invoked with a command that needs it, meaning most sub commands can now be used on systems without git
|
||||||
|
|
||||||
|
|
||||||
## Version 1.1.1 - 2022-08-15
|
## Version 1.1.1 - 2022-08-15
|
||||||
|
21
action.yaml
21
action.yaml
@ -1,12 +1,13 @@
|
|||||||
name: Yaclog
|
name: Yaclog
|
||||||
description: >
|
description: Get version information from a changelog
|
||||||
Get version information from a changelog, and optionally create a new release.
|
|
||||||
The `yaclog` command is made available for use in future steps.
|
|
||||||
branding:
|
branding:
|
||||||
icon: file-text
|
icon: file-text
|
||||||
color: orange
|
color: orange
|
||||||
|
|
||||||
inputs:
|
inputs:
|
||||||
|
changelog-path:
|
||||||
|
description: "Path of the changelog markdown file"
|
||||||
|
|
||||||
markdown:
|
markdown:
|
||||||
description: If outputs should be in markdown format or not
|
description: If outputs should be in markdown format or not
|
||||||
default: 'true'
|
default: 'true'
|
||||||
@ -52,14 +53,10 @@ runs:
|
|||||||
if: ${{ inputs.release }}
|
if: ${{ inputs.release }}
|
||||||
run: yaclog release --yes --commit ${{ inputs.release }}
|
run: yaclog release --yes --commit ${{ inputs.release }}
|
||||||
|
|
||||||
- name: Get Version Information
|
- name: Get Changelog Information
|
||||||
id: yaclog-show
|
id: yaclog-show
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: >
|
||||||
yaclog show ---gh-actions ${{ inputs.markdown && '--markdown' }} >> "$GITHUB_OUTPUT"
|
yaclog ${{ inputs.changelog-path && format('--path {0}', inputs.changelog-path) }}
|
||||||
# output like so:
|
show ---gh-actions ${{ inputs.markdown && '--markdown' }}
|
||||||
# name=Version 1.3.0
|
| tee -a "$GITHUB_OUTPUT"
|
||||||
# header=Version 1.3.0 - 2024-08-08
|
|
||||||
# version=1.3.0
|
|
||||||
# body_file={path to file containing version body}
|
|
||||||
# changelog={path to changelog}
|
|
@ -22,6 +22,8 @@ classifiers = [
|
|||||||
"Programming Language :: Python :: 3.8",
|
"Programming Language :: Python :: 3.8",
|
||||||
"Programming Language :: Python :: 3.9",
|
"Programming Language :: Python :: 3.9",
|
||||||
"Programming Language :: Python :: 3.10",
|
"Programming Language :: Python :: 3.10",
|
||||||
|
"Programming Language :: Python :: 3.11",
|
||||||
|
"Programming Language :: Python :: 3.12",
|
||||||
"Topic :: Text Processing :: Markup :: Markdown",
|
"Topic :: Text Processing :: Markup :: Markdown",
|
||||||
"Topic :: Software Development :: Version Control :: Git",
|
"Topic :: Software Development :: Version Control :: Git",
|
||||||
"Topic :: Utilities"
|
"Topic :: Utilities"
|
||||||
@ -55,6 +57,7 @@ Changelog = "https://github.com/drewcassidy/yaclog/blob/main/CHANGELOG.md"
|
|||||||
Docs = "https://yaclog.readthedocs.io/"
|
Docs = "https://yaclog.readthedocs.io/"
|
||||||
|
|
||||||
[tool.setuptools_scm]
|
[tool.setuptools_scm]
|
||||||
|
fallback_version = "0.0.0"
|
||||||
|
|
||||||
[tool.setuptools.packages.find]
|
[tool.setuptools.packages.find]
|
||||||
include = ["yaclog"]
|
include = ["yaclog"]
|
@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
import datetime
|
import datetime
|
||||||
import os.path
|
import os.path
|
||||||
|
from sys import stdout
|
||||||
|
|
||||||
import click
|
import click
|
||||||
|
|
||||||
@ -91,7 +92,7 @@ def show(obj: Changelog, all_versions, markdown, mode, version_names, gh_actions
|
|||||||
}
|
}
|
||||||
|
|
||||||
str_func = functions[mode]
|
str_func = functions[mode]
|
||||||
kwargs = {'md': markdown, 'color': True}
|
kwargs = {'md': markdown, 'color': stdout.isatty()}
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if all_versions:
|
if all_versions:
|
||||||
@ -115,6 +116,7 @@ def show(obj: Changelog, all_versions, markdown, mode, version_names, gh_actions
|
|||||||
if gh_actions:
|
if gh_actions:
|
||||||
import tempfile
|
import tempfile
|
||||||
|
|
||||||
|
kwargs['color'] = False
|
||||||
all_modes = [ 'name', 'header', 'version' ]
|
all_modes = [ 'name', 'header', 'version' ]
|
||||||
outputs = [f'{mode}={sep.join([functions[mode](v, kwargs) for v in versions])}' for mode in all_modes]
|
outputs = [f'{mode}={sep.join([functions[mode](v, kwargs) for v in versions])}' for mode in all_modes]
|
||||||
click.echo('\n'.join(outputs))
|
click.echo('\n'.join(outputs))
|
||||||
|
Reference in New Issue
Block a user