Skip to content

Commit 2c9e91a

Browse files
committed
chore: update demo to the latest cookiecutter-robust-python
1 parent f57de81 commit 2c9e91a

File tree

3 files changed

+38
-14
lines changed

3 files changed

+38
-14
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": "b3e8970d19722387b647d9eba165e948e1b7c41a",
2+
"_commit": "8b33de78451ca2e4cdb06bd2da3db5cf5d74ae2c",
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": "b3e8970d19722387b647d9eba165e948e1b7c41a",
3+
"commit": "8b33de78451ca2e4cdb06bd2da3db5cf5d74ae2c",
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": "b3e8970d19722387b647d9eba165e948e1b7c41a"
21+
"_commit": "8b33de78451ca2e4cdb06bd2da3db5cf5d74ae2c"
2222
}
2323
},
2424
"directory": null

.github/workflows/release-python.yml

Lines changed: 35 additions & 11 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
@@ -58,7 +78,6 @@ jobs:
5878
runs-on: ubuntu-latest
5979
needs: build_and_testpypi
6080

61-
if: "github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')"
6281
steps:
6382
- name: Download package artifacts
6483
uses: actions/download-artifact@v4
@@ -74,6 +93,11 @@ jobs:
7493
- name: Set up uv
7594
uses: astral-sh/setup-uv@v6
7695

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+
77101
- name: Publish to PyPI
78102
env:
79103
TWINE_USERNAME: __token__
@@ -83,4 +107,4 @@ jobs:
83107
- name: Publish to GitHub
84108
env:
85109
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
86-
run: gh release upload ${{ github.event.inputs.tag }} dist/
110+
run: gh release upload ${{ needs.build_and_testpypi.outputs.tag }} dist/

0 commit comments

Comments
 (0)