Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
60 changes: 60 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: release

on:
workflow_dispatch:
inputs:
bump:
description: Version bump
required: true
default: patch
type: choice
options:
- patch
- minor
- major

jobs:
release:
runs-on: ubuntu-latest
environment: pypi
permissions:
contents: write
id-token: write

steps:
- uses: actions/checkout@v4
with:
ref: master
fetch-depth: 0

- name: Install uv
uses: astral-sh/setup-uv@v6
with:
enable-cache: true

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.14"

- name: Install dependencies
run: uv sync --locked --python 3.14

- name: Lint and format with ruff
run: uv run ruff check . && uv run ruff format . --check

- name: Test with pytest
run: uv run pytest

- name: Create release
run: uv run semantic-release version --${{ inputs.bump }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload assets to GitHub release
run: uv run semantic-release publish
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Create a new version
# ------------------------------------------------------------------------------
version-patch:
uv run semantic-release publish --patch
uv run semantic-release version --patch

version-minor:
uv run semantic-release publish --minor
uv run semantic-release version --minor

version-major:
uv run semantic-release publish --major
uv run semantic-release version --major
19 changes: 10 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ Homepage = "https://github.com/systemallica/python-redsys"

[dependency-groups]
dev = [
"mypy>=1.6.1,<2",
"pre-commit>=3.5.0,<4",
"pytest>=8.3.5,<9",
"pytest-cov>=5,<8",
"python-semantic-release>=7.34.6,<8",
"ruff>=0.12.0,<1",
"mypy>=2.1.0",
"pre-commit>=4.6.0",
"pytest>=9.1.1",
"pytest-cov>=7.1.0",
"python-semantic-release>=10.5.3",
"ruff>=0.15.19",
]

[tool.uv.build-backend]
Expand All @@ -55,14 +55,15 @@ indent-style = "space"
force-single-line = true

[tool.semantic_release]
version_variable = [
version_variables = [
"redsys/__init__.py:__version__",
]
version_toml = ["pyproject.toml:project.version"]
upload_to_pypi = true
upload_to_release = true
build_command = "uv build"

[tool.semantic_release.publish]
upload_to_vcs_release = true

[build-system]
requires = ["uv_build>=0.11.24,<0.12"]
build-backend = "uv_build"
Loading
Loading