Skip to content

Commit 566ddc9

Browse files
authored
Merge pull request #5 from 56kyle/release/0.1.0
Release/0.1.0
2 parents d7e107f + 1f22704 commit 566ddc9

File tree

19 files changed

+368
-216
lines changed

19 files changed

+368
-216
lines changed

.cookiecutter.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"_commit": "dab1f8da6cb6be90a50db1aafb4411ec61fbcb2c",
2+
"_commit": "e75916b0cb7d49cc8b12acaf0af9098ec3ccca28",
33
"_template": "C:\\Users\\56kyl\\source\\repos\\cookiecutter-robust-python",
44
"add_rust_extension": false,
55
"author": "Kyle Oliver",

.cruft.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"template": "C:\\Users\\56kyl\\source\\repos\\cookiecutter-robust-python",
3-
"commit": "dab1f8da6cb6be90a50db1aafb4411ec61fbcb2c",
3+
"commit": "e75916b0cb7d49cc8b12acaf0af9098ec3ccca28",
44
"checkout": null,
55
"context": {
66
"cookiecutter": {
@@ -18,7 +18,7 @@
1818
"license": "MIT",
1919
"development_status": "Development Status :: 1 - Planning",
2020
"_template": "C:\\Users\\56kyl\\source\\repos\\cookiecutter-robust-python",
21-
"_commit": "dab1f8da6cb6be90a50db1aafb4411ec61fbcb2c"
21+
"_commit": "e75916b0cb7d49cc8b12acaf0af9098ec3ccca28"
2222
}
2323
},
2424
"directory": null

.github/workflows/bump-version.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Prepare Release
2+
3+
on:
4+
push:
5+
branches:
6+
- "release/*"
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
prepare-release:
13+
name: Prepare Release
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
fetch-tags: true
21+
22+
- name: Set up uv
23+
uses: astral-sh/setup-uv@v6
24+
25+
- name: Set up Python
26+
uses: actions/setup-python@v5
27+
with:
28+
python-version-file: .github/workflows/.python-version
29+
30+
- name: Get Current Version
31+
id: current_version
32+
run: echo "CURRENT_VERSION=$(uvx --from commitizen cz version -p)" >> $GITHUB_OUTPUT
33+
34+
- name: Get New Release Version
35+
id: new_version
36+
run: echo "NEW_VERSION=${GITHUB_REF_NAME#release/}" >> $GITHUB_OUTPUT
37+
38+
- name: Bump Version
39+
if: ${{ steps.current_version.outputs.CURRENT_VERSION != steps.new_version.outputs.NEW_VERSION }}
40+
run: uvx nox -s bump-version ${{ steps.new_version.outputs.NEW_VERSION }}
41+
42+
- name: Get Release Notes
43+
run: uvx nox -s get-release-notes -- ${{ github.workspace }}-CHANGELOG.md
44+
45+
- name: Create Release Draft
46+
uses: softprops/action-gh-release@v2
47+
with:
48+
body_path: ${{ github.workspace }}-CHANGELOG.md
49+
draft: true
50+
tag_name: ${{ steps.new_version.outputs.NEW_VERSION }}
51+
env:
52+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release-python.yml

Lines changed: 40 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,41 @@ name: Release Python Package
55

66
on:
77
push:
8-
tags:
9-
- "v[0-9]+.[0-9]+.[0-9]+"
10-
- "v[0-9]+.[0-9]+.[0-9]+-*" # Include pre-release tags
8+
branches:
9+
- main
10+
- master
1111

1212
workflow_dispatch:
13-
inputs:
14-
tag:
15-
description: "Git tag to build and release (e.g., v1.2.3). Must already exist."
16-
required: true
1713

1814
jobs:
15+
get_tag:
16+
name: Get Tag
17+
runs-on: ubuntu-latest
18+
outputs:
19+
tag: ${{ steps.current_version.outputs.CURRENT_VERSION }}
20+
steps:
21+
- name: Checkout code
22+
uses: actions/checkout@v4
23+
24+
- name: Set up uv
25+
uses: astral-sh/setup-uv@v6
26+
27+
- name: Set up Python
28+
uses: actions/setup-python@v5
29+
with:
30+
python-version-file: ".github/workflows/.python-version"
31+
32+
- name: Get Current Version
33+
id: current_version
34+
run: echo "CURRENT_VERSION=$(uvx --from commitizen cz version -p)" >> $GITHUB_OUTPUT
35+
36+
1937
build_and_testpypi:
2038
name: Build & Publish to TestPyPI
2139
runs-on: ubuntu-latest
22-
40+
needs: get_tag
41+
outputs:
42+
tag: ${{ needs.get_tag.outputs.tag }}
2343
steps:
2444
- name: Checkout code
2545
uses: actions/checkout@v4
@@ -44,7 +64,7 @@ jobs:
4464
- name: Download built package artifacts
4565
uses: actions/download-artifact@v4
4666
with:
47-
name: distribution-packages-${{ github.event.inputs.tag }}
67+
name: distribution-packages-${{ needs.get_tag.outputs.tag }}
4868
path: dist/
4969

5070
- name: Publish to TestPyPI
@@ -53,24 +73,11 @@ jobs:
5373
TWINE_PASSWORD: ${{ secrets.TESTPYPI_API_TOKEN }}
5474
run: uvx nox -s publish-package -- --repository testpypi
5575

56-
- name: Get Release Notes from Changelog
57-
id: changelog
58-
uses: simple-changelog/action@v3
59-
with:
60-
path: CHANGELOG.md
61-
tag: ${{ github.event_name == 'push' && github.ref_name || github.event.inputs.tag }}
62-
63-
outputs:
64-
changelog_body:
65-
description: "Release notes body extracted from CHANGELOG.md"
66-
value: ${{ steps.changelog.outputs.changes }} # Output the extracted changelog body
67-
68-
publish_pypi:
69-
name: Publish to Production PyPI
76+
publish_pypi_and_github:
77+
name: Publish to Production PyPI and GitHub
7078
runs-on: ubuntu-latest
7179
needs: build_and_testpypi
7280

73-
if: "github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')"
7481
steps:
7582
- name: Download package artifacts
7683
uses: actions/download-artifact@v4
@@ -86,34 +93,18 @@ jobs:
8693
- name: Set up uv
8794
uses: astral-sh/setup-uv@v6
8895

96+
- name: Create Tag
97+
run: |
98+
git tag ${{ needs.build_and_testpypi.outputs.tag }}
99+
git push origin ${{ needs.build_and_testpypi.outputs.tag }}
100+
89101
- name: Publish to PyPI
90102
env:
91103
TWINE_USERNAME: __token__
92104
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
93105
run: uvx nox -s publish-python
94106

95-
create_github_release:
96-
name: Create GitHub Release
97-
runs-on: ubuntu-latest
98-
needs: build_and_testpypi
99-
100-
if: "github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')"
101-
102-
steps:
103-
- name: Download package artifacts # Get built artifacts for release assets
104-
uses: actions/download-artifact@v4
105-
with:
106-
name: distribution-packages
107-
108-
- name: Get tag name
109-
id: get_tag
110-
run: echo "tag=${{ github.ref_name }}" >> $GITHUB_OUTPUT
111-
112-
- name: Create GitHub Release
113-
uses: softprops/action-gh-release@v2
114-
with:
115-
tag_name: ${{ steps.get_tag.outputs.tag }}
116-
name: Release ${{ steps.get_tag.outputs.tag }}
117-
body: ${{ needs.build_and_testpypi.outputs.changelog_body }}
118-
files: dist/*
119-
prerelease: ${{ contains(steps.get_tag.outputs.tag, '-') }} # Checks if tag contains hyphen (e.g. v1.0.0-rc.1)
107+
- name: Publish to GitHub
108+
env:
109+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
110+
run: gh release upload ${{ needs.build_and_testpypi.outputs.tag }} dist/

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,6 @@ nohup.out
7171

7272
# Prettier dependencies
7373
node_modules/
74+
75+
# Release Notes
76+
body.md

.ruff.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ max-complexity = 10
9898
]
9999
"exceptions.py" = ["D107"]
100100
"noxfile.py" = ["S101"]
101-
"scripts/*" = ["S603"]
101+
"scripts/*" = ["S603", "S607"]
102102

103103
[lint.pydocstyle]
104104
convention = "google"

CHANGELOG.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
## v0.1.0 (2025-07-16)
2+
3+
### Feat
4+
5+
- initial commit
6+
- remove unneeded python venvs from noxfile.py
7+
- run pre-commit autoupdate
8+
- initial commit
9+
- initial commit
10+
- initial commit
11+
- add new pre-commit hooks for validating the pyproject.toml
12+
- initial commit
13+
- initial commit
14+
- initial commit
15+
- initial commit
16+
- initial commit
17+
- initial commit
18+
- initial commit
19+
20+
### Fix
21+
22+
- resolve conflicts
23+
- resolve conflicts
24+
- fix path syntax in build-python.yml

build/lib/robust_python_demo/__init__.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

build/lib/robust_python_demo/__main__.py

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)