build: added develop package #6
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | 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/ |