Skip to content

Commit 99d68d2

Browse files
authored
Merge pull request #32 from sandialabs/fix-semantic-release
fix: Semantic release configuration
2 parents 92bdc1a + 0325dc0 commit 99d68d2

File tree

6 files changed

+32
-7
lines changed

6 files changed

+32
-7
lines changed

.github/workflows/semantic-release.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ jobs:
1111
concurrency: release
1212
permissions:
1313
id-token: write
14-
contents: write
1514

1615
steps:
1716
- uses: actions/checkout@v3
@@ -20,6 +19,19 @@ jobs:
2019
token: ${{ secrets.GH_TOKEN }}
2120

2221
- name: Python Semantic Release
22+
id: release
2323
uses: python-semantic-release/python-semantic-release@master
2424
with:
2525
github_token: ${{ secrets.GH_TOKEN }}
26+
root_options: "-vv"
27+
28+
- name: Publish to PyPI
29+
uses: pypa/gh-action-pypi-publish@release/v1
30+
if: steps.release.outputs.released == 'true'
31+
32+
- name: Publish to GitHub Releases
33+
uses: python-semantic-release/upload-to-gh-release@main
34+
if: steps.release.outputs.released == 'true'
35+
with:
36+
github_token: ${{ secrets.GH_TOKEN }}
37+
root_options: "-vv"

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
## v1.0.1 (2023-07-20)
77

8-
### Continuous Integration
8+
### Continuous Integration
99
* ci: Rename workflow file ([`1cfed2d`](https://github.com/sandialabs/reverse_argparse/commit/1cfed2d0bd8833e633f684e717745ac65997d7ad))
1010
* ci: Add conventional commits job ([`c683d7a`](https://github.com/sandialabs/reverse_argparse/commit/c683d7a9adf415f71816b190954cec4f4be3162d))
1111
* ci: Set up semantice-release ([`9f233be`](https://github.com/sandialabs/reverse_argparse/commit/9f233bea255a44c5bb8470330c746ca6a951377e))
@@ -45,7 +45,7 @@
4545
* chore: Add VS Code settings ([`cc4edb2`](https://github.com/sandialabs/reverse_argparse/commit/cc4edb2611ed25a8a90751c03c8f69c8221db642))
4646
* chore: Add __pycache__ to .gitignore ([`48a8acd`](https://github.com/sandialabs/reverse_argparse/commit/48a8acd77bad6b83a735b0540b5b184920715da9))
4747

48-
### Continuous Integration
48+
### Continuous Integration
4949
* ci: Remove documentation jobs ([`81ab9c2`](https://github.com/sandialabs/reverse_argparse/commit/81ab9c230c3a19c8268b878c6e9364e3e1882266))
5050

5151
Let ReadTheDocs test the PR instead.

pyproject.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,14 @@ python = ">=3.8"
6969

7070

7171
[tool.semantic_release]
72+
build_command = "python3 -m pip install poetry && poetry build"
7273
commit_message = """
73-
{version}
74+
chore: Release v{version}
7475
7576
Automatically generated by python-semantic-release."""
7677
version_variables = [
7778
"doc/source/conf.py:version",
79+
"reverse_argparse/__init__.py:__version__",
7880
]
7981
version_toml = [
8082
"pyproject.toml:tool.poetry.version",

reverse_argparse/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
from .reverse_argparse import ReverseArgumentParser, quote_arg_if_necessary
88

99
__all__ = ["ReverseArgumentParser", "quote_arg_if_necessary"]
10-
__version__ = "1.0.0"
10+
__version__ = "1.0.1"

templates/CHANGELOG.md.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
{% if context.history.unreleased | length > 0 %}
55
## Unreleased
66
{% for type_, commits in context.history.unreleased | dictsort %}
7-
### {{ type_ | capitalize if type_ != "ci" else "Continuous Integration "}}
7+
### {{ type_ | capitalize if type_ != "ci" else "Continuous Integration" }}
88
{% for commit in commits -%}
99
{%- set summary = commit.message.rstrip().splitlines()[0] -%}
1010
{%- set details = commit.message.rstrip().splitlines()[2:] -%}
@@ -18,7 +18,7 @@
1818
{% for version, release in context.history.released.items() -%}
1919
## {{ version.as_tag() }} ({{ release.tagged_date.strftime("%Y-%m-%d") }})
2020
{% for type_, commits in release["elements"] | dictsort %}
21-
### {{ type_ | capitalize if type_ != "ci" else "Continuous Integration "}}
21+
### {{ type_ | capitalize if type_ != "ci" else "Continuous Integration" }}
2222
{% for commit in commits -%}
2323
{%- set summary = commit.message.rstrip().splitlines()[0] -%}
2424
{%- set details = commit.message.rstrip().splitlines()[2:] -%}

templates/release_notes.md.j2

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# {{ version.as_tag() }} ({{ release.tagged_date.strftime("%Y-%m-%d") }})
2+
{% for type_, commits in release["elements"] | dictsort %}
3+
## {{ type_ | capitalize if type_ != "ci" else "Continuous Integration" }}
4+
{% for commit in commits -%}
5+
{%- set summary = commit.message.rstrip().splitlines()[0] -%}
6+
{%- set details = commit.message.rstrip().splitlines()[2:] -%}
7+
* {{ summary }} ([`{{ commit.hexsha[:7] }}`]({{ commit.hexsha | commit_hash_url }}))
8+
{% if details %}
9+
{% for line in details %}{% if line.strip() %} {{ line }}{% endif %}
10+
{% endfor %}{% endif %}{% endfor -%}
11+
{% endfor %}

0 commit comments

Comments
 (0)