Skip to content

build: added develop package #6

build: added develop package

build: added develop package #6

Workflow file for this run

name: Publish to PyPI
on:
release:
types: [published]
push:
branches: [develop]
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
id-token: write # REQUIRED: for trusted publishing
contents: read # REQUIRED: to checkout the repository
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Full history for proper versioning
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build twine setuptools-scm
- name: Determine target repository
id: target
run: |
if [[ "${{ github.event_name }}" == "release" ]]; then
echo "repository=pypi" >> $GITHUB_OUTPUT
echo "repository_url=" >> $GITHUB_OUTPUT
echo "Publishing release to PyPI"
else
echo "repository=testpypi" >> $GITHUB_OUTPUT
echo "repository_url=https://test.pypi.org/legacy/" >> $GITHUB_OUTPUT
echo "Publishing develop to TestPyPI"
fi
- name: Build package
run: python -m build
- name: Publish to PyPI (Release)
if: github.event_name == 'release'
uses: pypa/gh-action-pypi-publish@release/v1
- name: Publish to TestPyPI (Develop)
if: github.event_name == 'push' && github.ref == 'refs/heads/develop'
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/