From 95d7af03b780d09f878fbb44dc5a48ab9d293138 Mon Sep 17 00:00:00 2001 From: Marcin Kozlowski Date: Thu, 20 Feb 2025 16:21:49 +0100 Subject: [PATCH] Create publish-to-pypi.yml --- .github/workflows/publish-to-pypi.yml | 42 +++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/publish-to-pypi.yml diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml new file mode 100644 index 0000000..25abf28 --- /dev/null +++ b/.github/workflows/publish-to-pypi.yml @@ -0,0 +1,42 @@ +name: Publish Python Package + +on: + push: + branches: + - main # Replace with your default branch if different + +jobs: + publish: + runs-on: ubuntu-latest + + steps: + # Step 1: Check out the repository + - name: Check out code + uses: actions/checkout@v3 + with: + fetch-depth: 0 # Fetch the full Git history including tags + + + + # Step 2: Set up Python + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.12' + + # Step 3: Install build tools + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install build twine + + # Step 4: Build the package + - name: Build package + run: python -m build + + # Step 5: Publish to PyPI + - name: Publish to PyPI + env: + TWINE_USERNAME: "__token__" + TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} + run: twine upload dist/*