Skip to content
Merged
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
21 changes: 8 additions & 13 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# .github/workflows/release.yml
# This workflow will create a new release and upload it to PyPI. It will run
# whenever a new tag is merged into the repository. It builds the application
# and pushes it to PyPI.
# and pushes it to PyPI using trusted publisher (OIDC).
---
name: Release new version

Expand All @@ -12,6 +12,7 @@ on:

permissions:
contents: write
id-token: write # Required for trusted publisher (OIDC)

jobs:
build:
Expand All @@ -30,19 +31,13 @@ jobs:
- name: Install the project
run: uv sync --all-extras --dev

- name: Install tools
run: uv run pip install build twine

- name: Build package
run: uv run python -m build

- name: Publish to PyPI or TestPyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
echo "Publishing to PyPI..."
twine upload dist/*
run: uv build

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
print-hash: true

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
Expand Down