Skip to content

Commit

Permalink
chore: add github actions release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
phernandez committed Nov 15, 2024
1 parent 5ad08fb commit f32e6fe
Show file tree
Hide file tree
Showing 3 changed files with 200 additions and 7 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Release
on:
workflow_dispatch:
inputs:
version_type:
description: 'Type of version bump (major, minor, patch)'
required: true
default: 'patch'
type: choice
options:
- patch
- minor
- major
release:
types: [published]

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

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}

- name: Install uv
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Python Setup
uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Install dependencies
run: |
uv pip install ".[dev]"
- name: Release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: semantic-release publish
15 changes: 14 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ dev = [
"isort>=5.13.0",
"mypy>=1.8.0",
"ruff>=0.2.0",
"python-semantic-release>=9.14.0",
]

# Full install with all features
Expand Down Expand Up @@ -137,4 +138,16 @@ style = "default"
[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py"]
addopts = "-ra -q"
addopts = "-ra -q"


[tool.semantic_release]
version_variable = "basic_components/__init__.py:__version__"
version_toml = "pyproject.toml:project.version"
major_on_zero = false
branch = "main"
changelog_file = "CHANGELOG.md"
build_command = "uv build"
dist_path = "dist/"
upload_to_pypi = true
commit_message = "chore(release): {version} [skip ci]"
143 changes: 137 additions & 6 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f32e6fe

Please sign in to comment.