Skip to content

refactor: streamline Claude Code Review to focus on bugs and security… #457

refactor: streamline Claude Code Review to focus on bugs and security…

refactor: streamline Claude Code Review to focus on bugs and security… #457

Workflow file for this run

name: Release
on:
push:
branches:
- main
- master
env:
PYTHON_VERSION: "3.13"
jobs:
release:
name: Release
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.check-version.outputs.tag }}
steps:
- name: Check out the repository
uses: actions/checkout@v5
with:
fetch-depth: 2
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Check if there is a parent commit
id: check-parent-commit
run: |
echo "sha=$(git rev-parse --verify --quiet HEAD^)" >> $GITHUB_OUTPUT
- name: Detect and tag new version
id: check-version
if: steps.check-parent-commit.outputs.sha
uses: salsify/action-detect-and-tag-new-version@v2.0.3
with:
version-command: |
bash -c "uv version --short"
- name: Bump version for developmental release
if: "! steps.check-version.outputs.tag"
run: |
uv version --bump patch &&
version=$(uv version --short) &&
uv version $version.dev.$(date +%s)
- name: Build package
run: |
uv build
- name: Upload build package artifact
uses: actions/upload-artifact@v4
with:
name: dist
path: dist
retention-days: 1
- name: Publish the release notes
id: create-release
uses: release-drafter/release-drafter@v6.1.0
with:
publish: ${{ steps.check-version.outputs.tag != '' }}
tag: ${{ steps.check-version.outputs.tag }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
pypi-publish:
needs: release
environment:
name: publish
name: upload release to PyPI or TestPyPI
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- name: Download build package artifact
uses: actions/download-artifact@v5
with:
name: dist
path: dist
- name: Publish package distributions to PyPI
continue-on-error: true
if: needs.release.outputs.tag
uses: pypa/gh-action-pypi-publish@release/v1
- name: Publish package on TestPyPI
continue-on-error: true
if: "! needs.release.outputs.tag"
uses: pypa/gh-action-pypi-publish@v1.13.0
with:
repository-url: https://test.pypi.org/legacy/