fix(ci): restore Python 3.10 and 3.11 compatibility #7
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: | |
| push: | |
| tags: | |
| - 'v*' # Triggers on version tags like v0.1.0, v1.0.0 | |
| jobs: | |
| verify: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: npm | |
| cache-dependency-path: vscode-extension/package-lock.json | |
| - name: Verify tag matches package version | |
| shell: bash | |
| run: | | |
| PACKAGE_VERSION=$(python -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])") | |
| test "${GITHUB_REF_NAME}" = "v${PACKAGE_VERSION}" | |
| - name: Run release checks | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e ".[dev]" | |
| npm --prefix vscode-extension ci | |
| python scripts/verify.py --release | |
| - name: Preserve verified distributions | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: python-distributions | |
| path: dist/ | |
| if-no-files-found: error | |
| retention-days: 7 | |
| build-and-publish: | |
| runs-on: ubuntu-latest | |
| needs: verify | |
| permissions: | |
| id-token: write # Required for PyPI trusted publishing | |
| steps: | |
| - name: Download verified distributions | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: python-distributions | |
| path: dist/ | |
| - name: Publish to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| # Uses trusted publishing, no API token needed if configured on PyPI |