Skip to content

Commit

Permalink
Update python-publish.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
JrtPec authored Jan 31, 2025
1 parent a3fac06 commit 613c7cc
Showing 1 changed file with 18 additions and 10 deletions.
28 changes: 18 additions & 10 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,30 @@
name: Build and Publish Package
name: Publish Python Package

on:
release:
types: [published]
push:
tags:
- "v*.*.*" # Triggers on version tags like v0.1.0, v1.2.3, etc.

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

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # This ensures all tags are fetched

- name: Publish PyPI package
uses: cadifyai/poetry-publish@v0.1.0
- name: Build and publish to PyPI
uses: JRubics/poetry-publish@v2.1
with:
PYTHON_VERSION: "3.11"
POETRY_VERSION: "2.0.1"
POETRY_CORE_VERSION: "2.0.1"
ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PUBLISH_REGISTRY_PASSWORD: ${{ secrets.PYPI_TOKEN }}
python_version: "3.11" # Matches your pyproject.toml
poetry_version: "2.0.1" # Current stable version
pypi_token: ${{ secrets.PYPI_TOKEN }}
poetry_install_options: "--without dev --sync" # Don't install dev dependencies
plugins: "poetry-plugin-export" # Required by your project
# Optional: Test on TestPyPI first
# repository_name: "testpypi"
# repository_url: "https://test.pypi.org/legacy/"

0 comments on commit 613c7cc

Please sign in to comment.