Skip to content

Commit 76499c0

Browse files
authored
Merge pull request #2 from 56kyle/develop
Sync Project with generate-demo nox session and test CI/CD
2 parents 026b76f + 3f9e944 commit 76499c0

File tree

12 files changed

+32
-112
lines changed

12 files changed

+32
-112
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": "252149c8d29f972741ea3a7bbf5de824f4bdaabd",
2+
"_commit": "87a677683e54c30ad9ec09aba0c43a3572e4c215",
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": "252149c8d29f972741ea3a7bbf5de824f4bdaabd",
3+
"commit": "87a677683e54c30ad9ec09aba0c43a3572e4c215",
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": "252149c8d29f972741ea3a7bbf5de824f4bdaabd"
21+
"_commit": "87a677683e54c30ad9ec09aba0c43a3572e4c215"
2222
}
2323
},
2424
"directory": null

.github/workflows/build-python.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ jobs:
4747
- name: Set up Python
4848
uses: actions/setup-python@v5
4949
with:
50-
python-version-file: .python-version
50+
python-version-file: ".github\workflows\.python-version"
5151

5252
- name: Run package build
53-
run: uvx nox -s build-python-package
53+
run: uvx nox -s build-python
5454

5555
- name: Upload built packages artifact
5656
uses: actions/upload-artifact@v4

.github/workflows/docs-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
- name: Set up Python
4444
uses: actions/setup-python@v5
4545
with:
46-
python-version-file: .python-version
46+
python-version-file: ".github/workflows/.python-version"
4747

4848
- name: Build documentation
4949
run: uvx nox -s docs-build

.github/workflows/lint-global.yml

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

.github/workflows/lint-python.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
- name: Set up Python
4444
uses: actions/setup-python@v5
4545
with:
46-
python-version-file: .python-version
46+
python-version-file: ".github/workflows/.python-version"
4747

4848
- name: Run formatting checks
4949
run: uvx nox -s format-python

.github/workflows/release-python.yml

Lines changed: 6 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
- name: Set up Python
3333
uses: actions/setup-python@v5
3434
with:
35-
python-version-file: .python-version
35+
python-version-file: ".github/workflows/.python-version"
3636

3737
- name: Upload built package artifacts
3838
uses: actions/upload-artifact@v4
@@ -65,16 +65,11 @@ jobs:
6565
description: "Release notes body extracted from CHANGELOG.md"
6666
value: ${{ steps.changelog.outputs.changes }} # Output the extracted changelog body
6767

68-
# Job 2: Publish to Production PyPI
69-
# This job runs only if Job 1 completes successfully (implicit dependency)
70-
# and only on tag push events (NOT manual dispatch for production).
7168
publish_pypi:
7269
name: Publish to Production PyPI
7370
runs-on: ubuntu-latest
74-
# This job explicitly depends on build_and_testpypi completing successfully
7571
needs: build_and_testpypi
7672

77-
# Only run on tag push events, NOT on manual dispatch for the final PyPI publish
7873
if: "github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')"
7974
steps:
8075
- name: Download package artifacts
@@ -86,31 +81,22 @@ jobs:
8681
- name: Set up Python
8782
uses: actions/setup-python@v5
8883
with:
89-
python-version-file: .python-version
84+
python-version-file: ".github/workflows/.python-version"
9085

9186
- name: Set up uv
9287
uses: astral-sh/setup-uv@v6
9388

94-
# --- Publish to Production PyPI Step ---
9589
- name: Publish to PyPI
96-
# Execute the Task Automation publish session for Production PyPI.
97-
# Calls uv publish dist/* which defaults to pypi.org (Topic 10).
98-
# Configure Production PyPI credentials securely.
9990
env:
100-
# Production PyPI credentials stored as secrets in GitHub Settings -> Secrets
10191
TWINE_USERNAME: __token__
102-
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} # Use GitHub Encrypted Secret
103-
# Optional: TWINE_REPOSITORY if publishing to a custom production index
104-
run: uvx nox -s publish-package # Call the publish-package session (defaults to pypi.org)
92+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
93+
run: uvx nox -s publish-python
10594

106-
# Job 3: Create GitHub Release (Runs regardless of PyPI publish success, relies on build job for info/artifacts)
10795
create_github_release:
10896
name: Create GitHub Release
10997
runs-on: ubuntu-latest
110-
# Needs the build job (which includes getting changelog)
11198
needs: build_and_testpypi
11299

113-
# Only run this job if triggered by a tag push
114100
if: "github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')"
115101

116102
steps:
@@ -124,18 +110,10 @@ jobs:
124110
run: echo "tag=${{ github.ref_name }}" >> $GITHUB_OUTPUT
125111

126112
- name: Create GitHub Release
127-
# Uses a standard action to create a release in GitHub based on the tag.
128113
uses: softprops/action-gh-release@v2
129114
with:
130-
# The Git tag the release is associated with
131115
tag_name: ${{ steps.get_tag.outputs.tag }}
132-
# The name of the release (often the same as the tag)
133116
name: Release ${{ steps.get_tag.outputs.tag }}
134-
# The body of the release notes - access the output from the 'build_and_testpypi' job
135-
body: ${{ needs.build_and_testpypi.outputs.changelog_body }} # Access changelog body from dependent job output
136-
137-
files: dist/* # Attach built sdist and wheel files as release assets
138-
# Optional: Mark as a draft release for manual review before publishing
139-
# draft: true
140-
# Optional: Mark as a pre-release for tags containing hyphens (e.g., v1.0.0-rc1)
117+
body: ${{ needs.build_and_testpypi.outputs.changelog_body }}
118+
files: dist/*
141119
prerelease: ${{ contains(steps.get_tag.outputs.tag, '-') }} # Checks if tag contains hyphen (e.g. v1.0.0-rc.1)

.github/workflows/security-python.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
- name: Set up Python
4444
uses: actions/setup-python@v5
4545
with:
46-
python-version-file: .python-version
46+
python-version-file: ".github/workflows/.python-version"
4747

4848
- name: Run Python code security analysis
4949
run: uvx nox -s security-python

.github/workflows/test-python.yml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,18 @@ on:
2828

2929
jobs:
3030
test-python:
31-
name: Run Python Tests on ${{ matrix.os }}/${{ matrix.python-version }}
31+
name: Run Python Tests on ${{ matrix.os }}/${{ matrix.python }}
3232
runs-on: ${{ matrix.os }}
3333
strategy:
3434
matrix:
35-
python-version: [ "3.9", "3.10", "3.11", "3.12", "3.13" ]
36-
os: [ ubuntu-latest, windows-latest, macos-latest ]
37-
35+
include:
36+
- { python: "3.9", os: "ubuntu-latest" }
37+
- { python: "3.10", os: "ubuntu-latest" }
38+
- { python: "3.11", os: "ubuntu-latest" }
39+
- { python: "3.12", os: "ubuntu-latest" }
40+
- { python: "3.13", os: "ubuntu-latest" }
41+
- { python: "3.13", os: "macos-latest" }
42+
- { python: "3.13", os: "windows-latest" }
3843
steps:
3944
- name: Checkout code
4045
uses: actions/checkout@v4
@@ -45,21 +50,21 @@ jobs:
4550
- name: Set up Python
4651
uses: actions/setup-python@v5
4752
with:
48-
python-version: ${{ matrix.python-version }}
53+
python-version: ${{ matrix.python }}
4954

5055
- name: Run test suite
51-
run: uvx nox -s test-python
56+
run: uvx nox -s tests-python-${{ matrix.python }}
5257

5358
- name: Upload test reports
5459
uses: actions/upload-artifact@v4
5560
with:
56-
name: test-results-${{ matrix.os }}-py${{ matrix.python-version }}
61+
name: test-results-${{ matrix.os }}-py${{ matrix.python }}
5762
path: tests/results/*.xml
5863
retention-days: 5
5964

6065
- name: Upload coverage report
6166
uses: actions/upload-artifact@v4
6267
with:
63-
name: coverage-report-${{ matrix.os }}-py${{ matrix.python-version }}
68+
name: coverage-report-${{ matrix.os }}-py${{ matrix.python }}
6469
path: coverage.xml
6570
retention-days: 5

.github/workflows/typecheck-python.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,4 @@ jobs:
5050
python-version: ${{ matrix.python-version }}
5151

5252
- name: Run Python type checking
53-
run: uvx nox -s typecheck-python
53+
run: uvx nox -s typecheck-${{ matrix.python-version }}

0 commit comments

Comments
 (0)