Skip to content

deps(deps): bump ruff from 0.12.9 to 0.12.11 #47

deps(deps): bump ruff from 0.12.9 to 0.12.11

deps(deps): bump ruff from 0.12.9 to 0.12.11 #47

Workflow file for this run

name: Test and Release Template
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
pull_request:
branches:
- main
workflow_dispatch:
permissions:
contents: write
id-token: write
pull-requests: read
jobs:
get-python-versions:
name: Get Python test versions from pyproject.toml
runs-on: ubuntu-latest
outputs:
python-versions: ${{ steps.extract.outputs.versions }}
steps:
- uses: actions/checkout@v5
- name: Install uv
uses: astral-sh/setup-uv@v6
- name: Install dependencies
run: uv sync
- name: Extract Python test versions
id: extract
run: |
# Try to extract test versions from pyproject.toml, fallback to default if missing
if versions=$(uv run toml get --toml-path pyproject.toml tool.python-package-cookiecutter.ci.test-python-versions 2>/dev/null); then
echo "Using Python versions from pyproject.toml: $versions"
echo "versions=$versions" >> $GITHUB_OUTPUT
else
echo "No test-python-versions found in pyproject.toml, using default versions"
echo 'versions=["3.11", "3.12", "3.13"]' >> $GITHUB_OUTPUT
fi
test:
name: Test Template
needs: get-python-versions
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ${{ fromJSON(needs.get-python-versions.outputs.python-versions) }}
steps:
- uses: actions/checkout@v5
- name: Configure git for tests
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "[email protected]"
- name: Install uv and set Python version
uses: astral-sh/setup-uv@v6
with:
python-version: ${{ matrix.python-version }}
enable-cache: true
- name: Install dependencies
run: uv sync
- name: Run fast test suite
run: uv run poe test_fast
github-release:
name: Create GitHub Release & Update Changelog
needs: test
if: |
github.ref_type == 'tag' &&
startsWith(github.ref, 'refs/tags/v') &&
!endsWith(github.ref, '-test') &&
success()
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Auto-generate Changelog
uses: BobAnkh/[email protected]
with:
REPO_NAME: 'JnyJny/python-package-cookiecutter'
ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PATH: 'CHANGELOG.md'
COMMIT_MESSAGE: 'docs(CHANGELOG): update release notes'
TYPE: 'feat:Feature,bug:Bug Fixes,fix:Bug Fixes,docs:Documentation,refactor:Refactor,perf:Performance Improvements'
- name: Generate release notes
id: release_notes
run: |
set -euo pipefail
# Get the tag name
TAG_NAME=${GITHUB_REF#refs/tags/}
echo "Generating release notes for tag: $TAG_NAME"
# Get the previous tag
if PREVIOUS_TAG=$(git describe --tags --abbrev=0 ${TAG_NAME}^ 2>/dev/null); then
echo "Previous tag found: $PREVIOUS_TAG"
echo "## Changes since $PREVIOUS_TAG" >> release_notes.md
echo "" >> release_notes.md
git log --pretty=format:"- %s (%h)" ${PREVIOUS_TAG}..${TAG_NAME} >> release_notes.md
else
echo "No previous tag found, generating initial release notes"
echo "## Initial Release" >> release_notes.md
echo "" >> release_notes.md
echo "- Initial release of python-package-cookiecutter template" >> release_notes.md
fi
# Check if there's a CHANGELOG.md file
if [[ -f "CHANGELOG.md" ]]; then
echo "Adding CHANGELOG.md reference"
echo "" >> release_notes.md
echo "## Full Changelog" >> release_notes.md
echo "" >> release_notes.md
echo "See [CHANGELOG.md](CHANGELOG.md) for complete release notes." >> release_notes.md
fi
echo "Generated release notes:"
cat release_notes.md
- name: Create GitHub Release
uses: ncipollo/release-action@v1
with:
bodyFile: "release_notes.md"
draft: false
prerelease: false
generateReleaseNotes: true
token: ${{ secrets.GITHUB_TOKEN }}