v3.7.1 #133
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: Upload Python Package | |
| on: | |
| release: | |
| types: [published] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| enable-cache: true | |
| cache-dependency-glob: "uv.lock" | |
| - name: Install dependencies | |
| run: uv sync --all-extras | |
| - name: Build package | |
| run: uvx --from build pyproject-build --installer uv | |
| - name: Sanity check version matches tag... | |
| run: | | |
| uv pip install dist/*.whl | |
| BUILT_VERSION=$(uv run python -c "import eyepop; print(eyepop.__version__)") | |
| RELEASE_TAG="${{ github.event.release.tag_name }}" | |
| # Strip v prefix if it's there | |
| EXPECTED_VERSION="${RELEASE_TAG#v}" | |
| if [ "$BUILT_VERSION" != "$EXPECTED_VERSION" ]; then | |
| echo "ERROR: Built version ($BUILT_VERSION) does not match release tag ($EXPECTED_VERSION)" | |
| exit 1 | |
| fi | |
| echo "Same version as tag!" | |
| - name: Check wheel contents for py.typed marker | |
| run: | | |
| echo "Check for proper wheel contents..." | |
| WHEEL_FILE=$(ls dist/*.whl) | |
| unzip -l "$WHEEL_FILE" | grep -E "\.py$|\.pyi$" | wc -l | |
| unzip -l "$WHEEL_FILE" | grep "py.typed" || (echo "ERROR: py.typed marker missing!" && exit 1) | |
| echo "Proper wheel contents!" | |
| - name: Publish to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| user: __token__ | |
| password: ${{ secrets.PYPI_API_TOKEN }} | |