fix: use Path.name for cross-platform directory extraction (#52) #58
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: Release | |
| on: | |
| push: | |
| branches: [main] | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| release-please: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| release_created: ${{ steps.release.outputs.release_created }} | |
| tag_name: ${{ steps.release.outputs.tag_name }} | |
| steps: | |
| - uses: googleapis/release-please-action@v4 | |
| id: release | |
| with: | |
| release-type: python | |
| publish-pypi: | |
| name: Publish to PyPI | |
| needs: release-please | |
| if: needs.release-please.outputs.release_created == 'true' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read # checkout | |
| id-token: write # OIDC for PyPI trusted publishing | |
| steps: | |
| - name: Checkout release tag | |
| uses: actions/checkout@v5 | |
| with: | |
| ref: ${{ needs.release-please.outputs.tag_name }} | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.14" | |
| - name: Set up uv | |
| uses: astral-sh/setup-uv@v5 | |
| - name: Build distributions (sdist/wheel) | |
| run: uv build | |
| - name: Publish to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| print-hash: true | |
| # snapshot-docs: | |
| # needs: release-please | |
| # if: needs.release-please.outputs.release_created | |
| # runs-on: ubuntu-latest | |
| # steps: | |
| # - uses: actions/checkout@v5 | |
| # with: | |
| # ref: main | |
| # fetch-depth: 0 | |
| # - name: Snapshot docs (latest -> releases/vX.Y.Z) | |
| # run: | | |
| # VERSION=${{ needs.release-please.outputs.tag_name }} | |
| # VERSION=${VERSION#v} | |
| # if [ -d "docs/releases/v${VERSION}" ]; then | |
| # echo "docs/releases/v${VERSION} already exists; skipping." | |
| # exit 0 | |
| # fi | |
| # mkdir -p docs/releases | |
| # rsync -av --exclude 'specs/wip/**' --exclude 'tasks/AGENTS.md' \ | |
| # docs/latest/ docs/releases/v${VERSION}/ | |
| # git config user.name "github-actions" | |
| # git config user.email "[email protected]" | |
| # git add docs/releases | |
| # git commit -m "chore: snapshot docs v${VERSION}" || true | |
| # git push origin main |