Upload Python Package #41
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: Upload Python Package | |
| on: | |
| workflow_dispatch: # Allows the workflow to be run manually from GitHub | |
| inputs: | |
| version: | |
| description: 'Version of the package to publish' | |
| required: true | |
| release: | |
| types: [published] | |
| push: | |
| tags: | |
| - 'v*' # Triggers when a version tag is pushed (e.g., v1.0.0) | |
| permissions: | |
| contents: read | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v3 | |
| with: | |
| python-version: '3.10.10' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install build twine==6.0.1 | |
| - name: Build singul | |
| run: python -m build build_singul | |
| - name: Publish package with Twine | |
| run: | | |
| python -m twine upload build_singul/dist/* | |
| env: | |
| TWINE_USERNAME: __token__ | |
| TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | |
| TWINE_REPOSITORY_URL: https://upload.pypi.org/legacy/ | |
| ACTIONS_STEP_DEBUG: true # Enables debug mode for this step | |
| - name: Build shufflepy | |
| run: python -m build build_shufflepy | |
| - name: Publish package with Twine | |
| run: | | |
| python -m twine upload build_shufflepy/dist/* | |
| env: | |
| TWINE_USERNAME: __token__ | |
| TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | |
| TWINE_REPOSITORY_URL: https://upload.pypi.org/legacy/ | |
| ACTIONS_STEP_DEBUG: true # Enables debug mode for this step |