Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ on:
release:
types: [published]

permissions:
contents: write
id-token: write

jobs:
build-and-publish:
runs-on: ubuntu-latest
Expand All @@ -34,6 +38,10 @@ jobs:
run: |
VERSION=$(grep '^version = ' pyproject.toml | head -1 | cut -d '"' -f2)
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Set up git for pushing
if: github.ref == 'refs/heads/main'
run: |
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
- name: Create and push tag for new version
if: github.ref == 'refs/heads/main'
run: |
Expand All @@ -52,7 +60,4 @@ jobs:
python -m build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
# No password needed! Uses OIDC trusted publisher
permissions:
contents: read
id-token: write
# No password needed! Uses OIDC trusted publisher