Stellium 0.2.0 #1
Workflow file for this run
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] | |
| workflow_dispatch: | |
| inputs: | |
| test_pypi: | |
| description: 'Publish to TestPyPI instead of PyPI' | |
| required: false | |
| default: 'true' | |
| type: boolean | |
| jobs: | |
| build-and-publish: | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: pypi | |
| url: https://pypi.org/project/stellium/ | |
| permissions: | |
| id-token: write # Required for trusted publishing | |
| contents: read | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Fetch all history for proper version detection | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install build tools | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install build twine | |
| - name: Build package | |
| run: python -m build | |
| - name: Check distribution files | |
| run: | | |
| echo "Distribution files created:" | |
| ls -lh dist/ | |
| echo "Checking tarball contents for Swiss Ephemeris data:" | |
| tar -tzf dist/*.tar.gz | grep -E "\.se1|swisseph" || echo "Warning: Swiss Ephemeris data files not found" | |
| - name: Publish to TestPyPI | |
| if: ${{ github.event.inputs.test_pypi == 'true' || github.event_name == 'workflow_dispatch' }} | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| repository-url: https://test.pypi.org/legacy/ | |
| skip-existing: true | |
| - name: Publish to PyPI | |
| if: ${{ github.event_name == 'release' && github.event.action == 'published' }} | |
| uses: pypa/gh-action-pypi-publish@release/v1 |