Skip to content
Open
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
20 changes: 19 additions & 1 deletion .github/workflows/pypi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ jobs:
# c.f. https://docs.pypi.org/trusted-publishers/using-a-publisher/
permissions:
id-token: write
contents: write # required to push with GITHUB_TOKEN
env:
BRANCH: ${{ github.event.release.target_commitish }}

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ssh-key: ${{ secrets.DEPLOY_KEY }}

- name: Set up Python 3.12
uses: actions/setup-python@v5
Expand All @@ -45,6 +45,24 @@ jobs:
run: |
sed -i "/version =/ s/= \"[^\"]*\"/= \"${{ env.RELEASE_VERSION }}\"/" pyproject.toml

- name: commit version-bump
run: |
git config --local user.name "github-actions[bot]"
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git add ./pyproject.toml

# Check if there are changes to commit
if ! git diff --cached --quiet; then
echo "Changes detected, committing..."
git commit -m "Update version to ${{ env.RELEASE_VERSION }}" --no-verify
else
echo "No changes to commit"
fi

- name: Push commit
run: |
git push origin HEAD:$BRANCH

- name: Build a sdist and wheel
run: |
python -m build .
Expand Down
Loading