Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
a7a3776
feat: add initial implementation of the calendar version release cicd
56kyle Nov 30, 2025
34fc165
docs: update CONTRIBUTING.md info
56kyle Nov 30, 2025
4345fa5
docs: fix pre-commit install method in CONTRIBUTING.md
56kyle Nov 30, 2025
7d4cc40
refactor: move get_current_version into bump-version script to avoid …
56kyle Nov 30, 2025
e2940a7
refactor: move tag-version into its own script for the time being
56kyle Nov 30, 2025
782ea9b
chore: update uv.lock
56kyle Nov 30, 2025
3483e9e
fix: replace uv run call in update-demo nox session with install_and_…
56kyle Nov 30, 2025
58f3520
fix: update names throughout nox session and file along with fix upda…
56kyle Nov 30, 2025
8017439
chore: manually set environ variable in pytest demos_folder fixture s…
56kyle Nov 30, 2025
bf45c15
feat: add initial implementation of setup-release nox session and cor…
56kyle Nov 30, 2025
63ebafa
feat: add check for when the template is already in sync with the demo
56kyle Nov 30, 2025
fd27f00
fix: remove github.workspace from uses path
56kyle Nov 30, 2025
c940656
fix: change paths pointing toward update-demo reusable workflow
56kyle Nov 30, 2025
7748072
chore: lint a few scripts
56kyle Nov 30, 2025
e129799
fix: tweak gitlab ci to not error from too many uv cache keyfiles bei…
56kyle Nov 30, 2025
2f4adf2
chore: alter initial checkout location to see if it fixes actions ref…
56kyle Dec 1, 2025
e74104f
chore: remove path provided to see if it fixes reference issues
56kyle Dec 1, 2025
13bf965
fix: move reusable workflow usage to the job level and piece together…
56kyle Dec 1, 2025
6097e9c
fix: set references to python version file as absolute positions due …
56kyle Dec 1, 2025
0198495
feat: add small check to gracefully exit when trying to create an exi…
56kyle Dec 1, 2025
bda6c83
fix: swap to nox session install and run script for merge-demo-featur…
56kyle Dec 1, 2025
7969d23
feat: add default option to use current branch and add placeholder de…
56kyle Dec 1, 2025
e4bf34d
fix: change type of demos_cache_folder to prevent validation error fo…
56kyle Dec 1, 2025
1df0744
fix: add missing demo env info pass through into nox session install …
56kyle Dec 1, 2025
c414c81
feat: remove unneeded prior install now that PEP 723 is being used
56kyle Dec 1, 2025
9197f20
fix: remove faulty quotes in jq expression for merge-demo-feature script
56kyle Dec 1, 2025
d5b8fe5
fix: specify --merge in merge-demo-feature script attempt at merging …
56kyle Dec 1, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .cz.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[tool.commitizen]
tag_format = "v$version"
version_provider = "pep621"
update_changelog_on_bump = true
1 change: 1 addition & 0 deletions .github/workflows/.python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.10
28 changes: 24 additions & 4 deletions .github/workflows/merge-demo-feature.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,17 @@ env:
ROBUST_MATURIN_DEMO__APP_AUTHOR: ${{ github.repository_owner }}

jobs:
update-demo:
name: Update Demo
uses: ./.github/workflows/update-demo.yml
strategy:
matrix:
demo_name:
- "robust-python-demo"
- "robust-maturin-demo"
with:
demo_name: ${{ matrix.demo_name }}

merge-demo-feature:
name: Merge Demo Feature
runs-on: ubuntu-latest
Expand All @@ -24,12 +35,21 @@ jobs:
uses: actions/checkout@v4
with:
repository: ${{ github.repository }}
path: "${{ github.workspace }}/cookiecutter-robust-python"

- name: Sync Demo
uses: "${{ github.workspace }}/cookiecutter-robust-python/.github/workflows/update-demo.yml"
- name: Checkout Demo
uses: actions/checkout@v4
with:
repository: "${{ github.repository_owner }}/${{ inputs.demo_name }}"
path: ${{ inputs.demo_name }}
ref: develop

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

- name: Set up Python
uses: actions/setup-python@v5
with:
demo_name: ${{ matrix.demo_name }}
python-version-file: "${{ github.workspace }}/cookiecutter-robust-python/.github/workflows/.python-version"

- name: Merge Demo Feature PR into Develop
working-directory: "${{ github.workspace }}/${{ matrix.demo_name }}"
Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Prepare Release

on:
push:
branches:
- "release/*"

permissions:
contents: write

jobs:
prepare-release:
name: Prepare Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true

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

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version-file: .github/workflows/.python-version

- name: Get Current Version
id: current_version
run: echo "CURRENT_VERSION=$(uvx --from commitizen cz version -p)" >> $GITHUB_OUTPUT

- name: Get New Release Version
id: new_version
run: echo "NEW_VERSION=${GITHUB_REF_NAME#release/}" >> $GITHUB_OUTPUT

- name: Bump Version
if: ${{ steps.current_version.outputs.CURRENT_VERSION != steps.new_version.outputs.NEW_VERSION }}
run: uvx nox -s bump-version ${{ steps.new_version.outputs.NEW_VERSION }}

- name: Get Release Notes
run: uvx nox -s get-release-notes -- ${{ github.workspace }}-CHANGELOG.md

- name: Create Release Draft
uses: softprops/action-gh-release@v2
with:
body_path: ${{ github.workspace }}-CHANGELOG.md
draft: true
tag_name: v${{ steps.new_version.outputs.NEW_VERSION }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
147 changes: 147 additions & 0 deletions .github/workflows/release-template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
# .github/workflows/release-template.yml
# Automated release workflow for the cookiecutter-robust-python template
# Uses Calendar Versioning (CalVer): YYYY.MM.MICRO

name: Release Template

on:
push:
branches:
- main

workflow_dispatch:
inputs:
micro_version:
description: 'Override micro version (leave empty for auto-increment)'
required: false
type: string

jobs:
bump_and_build:
name: Bump Version & Build
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.VERSION }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true

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

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version-file: ".github/workflows/.python-version"

- name: Configure Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"

- name: Bump version and generate changelog
run: |
if [ -n "${{ inputs.micro_version }}" ]; then
uvx nox -s bump-version -- ${{ inputs.micro_version }}
else
uvx nox -s bump-version
fi

- name: Get version
id: version
run: |
VERSION=$(uvx --from commitizen cz version -p)
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT

- name: Push version bump commit
run: git push origin HEAD

- name: Build packages
run: uvx nox -s build-python

- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: dist-${{ steps.version.outputs.VERSION }}
path: dist/
retention-days: 7

publish_testpypi:
name: Publish to TestPyPI
runs-on: ubuntu-latest
needs: bump_and_build
permissions:
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@v4

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

- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: dist-${{ needs.bump_and_build.outputs.version }}
path: dist/

- name: Publish to TestPyPI
run: uvx nox -s publish-python -- --test-pypi

publish_pypi:
name: Tag & Publish to PyPI
runs-on: ubuntu-latest
needs: [bump_and_build, publish_testpypi]
permissions:
id-token: write
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: main

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

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version-file: ".github/workflows/.python-version"

- name: Configure Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"

- name: Pull latest (includes version bump)
run: git pull origin main

- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: dist-${{ needs.bump_and_build.outputs.version }}
path: dist/

- name: Create and push tag
run: uvx nox -s tag-version -- push

- name: Publish to PyPI
run: uvx nox -s publish-python

- name: Extract release notes
run: uvx nox -s get-release-notes -- release_notes.md

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ needs.bump_and_build.outputs.version }}
name: v${{ needs.bump_and_build.outputs.version }}
body_path: release_notes.md
files: dist/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16 changes: 3 additions & 13 deletions .github/workflows/sync-demos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,11 @@ on:
jobs:
update-demo:
name: Update Demo
runs-on: ubuntu-latest

uses: ./.github/workflows/update-demo.yml
strategy:
matrix:
demo_name:
- "robust-python-demo"
- "robust-maturin-demo"
steps:
- name: Checkout Template
uses: actions/checkout@v4
with:
repository: ${{ github.repository }}
path: "${{ github.workspace }}/cookiecutter-robust-python"

- name: Update Demo
uses: "${{ github.workspace }}/cookiecutter-robust-python/.github/workflows/update-demo.yml"
with:
demo_name: ${{ matrix.demo_name }}
with:
demo_name: ${{ matrix.demo_name }}
8 changes: 7 additions & 1 deletion .github/workflows/update-demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ jobs:
update-demo:
runs-on: ubuntu-latest
steps:
- name: Checkout Template
uses: actions/checkout@v4
with:
repository: ${{ github.repository }}
path: "${{ github.workspace }}/cookiecutter-robust-python"

- name: Checkout Demo
uses: actions/checkout@v4
with:
Expand All @@ -29,7 +35,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version-file: ".github/workflows/.python-version"
python-version-file: "${{ github.workspace }}/cookiecutter-robust-python/.github/workflows/.python-version"

- name: Update Demo
working-directory: "${{ github.workspace }}/cookiecutter-robust-python"
Expand Down
Loading
Loading