v0.26.1 #64
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 Release | |
| on: | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| jobs: | |
| publish-python-release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| environment: release | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v7 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| - name: Set up Python | |
| run: uv python install 3.12 | |
| - name: Install dependencies | |
| run: uv sync --all-extras | |
| - name: Build package | |
| run: uv build -o dist/py | |
| - name: Verify build artifacts | |
| run: | | |
| echo "=== Build artifacts ===" | |
| ls -la dist/py/ | |
| if ! ls dist/py/*.whl 1>/dev/null 2>&1 || ! ls dist/py/*.tar.gz 1>/dev/null 2>&1; then | |
| echo "ERROR: Expected wheel and sdist not found in dist/py/" | |
| exit 1 | |
| fi | |
| echo "Build artifacts verified successfully" | |
| - name: Publish package distributions to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| packages-dir: dist/py/ | |
| # Pre-release versions (alpha, beta, rc) are automatically detected by PyPI | |
| # based on PEP 440 version format (e.g., 0.15.0a1, 0.15.0b1, 0.15.0rc1) | |
| publish-js-release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v7 | |
| # Setup .npmrc file to publish to npm | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| registry-url: 'https://registry.npmjs.org' | |
| package-manager-cache: false | |
| - run: npm ci | |
| - run: npm run build | |
| # For pre-releases (alpha, beta, rc), publish with appropriate npm tag | |
| # This prevents pre-releases from becoming the "latest" tag | |
| - name: Determine npm tag | |
| id: npm-tag | |
| run: | | |
| VERSION=$(node -p "require('./package.json').version") | |
| if [[ "$VERSION" == *"-alpha"* ]] || [[ "$VERSION" == *"-beta"* ]] || [[ "$VERSION" == *"-rc"* ]]; then | |
| echo "tag=next" >> $GITHUB_OUTPUT | |
| else | |
| echo "tag=latest" >> $GITHUB_OUTPUT | |
| fi | |
| - run: npm publish --provenance --access public --tag ${{ steps.npm-tag.outputs.tag }} |