File tree 1 file changed +21
-0
lines changed
1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 11
11
# c.f. https://docs.pypi.org/trusted-publishers/using-a-publisher/
12
12
permissions :
13
13
id-token : write
14
+ contents : write # required to push with GITHUB_TOKEN
14
15
15
16
steps :
16
17
- uses : actions/checkout@v4
42
43
run : |
43
44
sed -i '/version =/ s/= "[^"][^"]*"/ = "${{ env.RELEASE_VERSION }}"/' pyproject.toml
44
45
46
+ - name : commit version-bump
47
+ run : |
48
+ git config --local user.name "github-actions[bot]"
49
+ git config --local user.email "github-actions[bot]@users.noreply.github.com"
50
+ git add ./pyproject.toml
51
+
52
+ # Check if there are changes to commit
53
+ if ! git diff --cached --quiet; then
54
+ echo "Changes detected, committing..."
55
+ git commit -m "Update version to ${{ env.RELEASE_VERSION }}" --no-verify
56
+ else
57
+ echo "No changes to commit"
58
+ fi
59
+
60
+ - name : Push commit
61
+ # GITHUB_TOKEN is automatically provided
62
+ run : |
63
+ git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
64
+ git push origin HEAD:$BRANCH
65
+
45
66
- name : Build a sdist and wheel
46
67
run : |
47
68
python -m build .
You can’t perform that action at this time.
0 commit comments