mirror of
https://github.com/drewcassidy/yaclog.git
synced 2024-09-01 14:58:58 +00:00
Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
0666f7f593 | |||
51e28e4ef0 | |||
a7cbacb687 | |||
3fa529a05c | |||
396960fae0 | |||
c661be05dc | |||
2f4124c0fc |
6
.github/workflows/python-publish.yml
vendored
6
.github/workflows/python-publish.yml
vendored
@ -9,14 +9,14 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
python-version: [ "3.8", "3.9", "3.10" ]
|
python-version: [ "3.8", "3.9", "3.10", "3.11" ]
|
||||||
click-version: [ "click~=7.0", "click~=8.0" ]
|
click-version: [ "click~=7.0", "click~=8.0" ]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Set up Python ${{ matrix.python-version }}
|
- name: Set up Python ${{ matrix.python-version }}
|
||||||
uses: actions/setup-python@v4.2.0
|
uses: actions/setup-python@v4.4.0
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python-version }}
|
python-version: ${{ matrix.python-version }}
|
||||||
|
|
||||||
@ -48,7 +48,7 @@ jobs:
|
|||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v4.2.0
|
uses: actions/setup-python@v4.4.0
|
||||||
with:
|
with:
|
||||||
python-version: '3.x'
|
python-version: '3.x'
|
||||||
|
|
||||||
|
@ -2,6 +2,13 @@
|
|||||||
|
|
||||||
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.1.2 - 2022-12-29
|
||||||
|
|
||||||
|
### 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
|
||||||
|
|
||||||
|
|
||||||
## Version 1.1.1 - 2022-08-15
|
## Version 1.1.1 - 2022-08-15
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
@ -16,10 +16,8 @@
|
|||||||
|
|
||||||
import datetime
|
import datetime
|
||||||
import os.path
|
import os.path
|
||||||
from ..cli import cargo_toml
|
|
||||||
|
|
||||||
import click
|
import click
|
||||||
import git
|
|
||||||
|
|
||||||
import yaclog.version
|
import yaclog.version
|
||||||
from yaclog.changelog import Changelog
|
from yaclog.changelog import Changelog
|
||||||
@ -52,7 +50,7 @@ def init(obj: Changelog):
|
|||||||
click.echo(f'Created new changelog file at {obj.path}')
|
click.echo(f'Created new changelog file at {obj.path}')
|
||||||
|
|
||||||
|
|
||||||
@cli.command('format') # dont accidentally hide the `format` python builtin
|
@cli.command('format') # don't accidentally hide the `format` python builtin
|
||||||
@click.pass_obj
|
@click.pass_obj
|
||||||
def reformat(obj: Changelog):
|
def reformat(obj: Changelog):
|
||||||
"""Reformat the changelog file."""
|
"""Reformat the changelog file."""
|
||||||
@ -254,10 +252,12 @@ def release(obj: Changelog, version_name, rel_seg, pre_seg, commit, cargo):
|
|||||||
short_version = cur_version.name.replace(' ', '-')
|
short_version = cur_version.name.replace(' ', '-')
|
||||||
|
|
||||||
if cargo:
|
if cargo:
|
||||||
|
from ..cli import cargo_toml
|
||||||
cargo_toml.set_version("Cargo.toml", str(short_version))
|
cargo_toml.set_version("Cargo.toml", str(short_version))
|
||||||
click.echo("Updated Cargo.toml")
|
click.echo("Updated Cargo.toml")
|
||||||
|
|
||||||
if commit:
|
if commit:
|
||||||
|
import git
|
||||||
repo = git.Repo(os.curdir)
|
repo = git.Repo(os.curdir)
|
||||||
|
|
||||||
if repo.bare:
|
if repo.bare:
|
||||||
@ -291,6 +291,7 @@ def release(obj: Changelog, version_name, rel_seg, pre_seg, commit, cargo):
|
|||||||
else:
|
else:
|
||||||
commit = repo.head.commit
|
commit = repo.head.commit
|
||||||
|
|
||||||
|
# noinspection PyTypeChecker
|
||||||
repo_tag = repo.create_tag(short_version, ref=commit, message=cur_version.body(False))
|
repo_tag = repo.create_tag(short_version, ref=commit, message=cur_version.body(False))
|
||||||
click.echo(f"Created tag {click.style(repo_tag.name, fg='green')}.")
|
click.echo(f"Created tag {click.style(repo_tag.name, fg='green')}.")
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user