Skip to content

Commit 0dec710

Browse files
committed
ci: Add workflow to bump pyside6 version
1 parent ad0fdb8 commit 0dec710

1 file changed

Lines changed: 50 additions & 0 deletions

File tree

.github/workflows/bump-pyside.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Bump PySide6 version
2+
on:
3+
schedule:
4+
- cron: "0 12 * * *" # Daily at noon UTC
5+
workflow_dispatch:
6+
7+
permissions:
8+
contents: write
9+
pull-requests: write
10+
11+
jobs:
12+
bump:
13+
runs-on: ubuntu-latest
14+
env:
15+
GH_TOKEN: ${{ github.token }}
16+
steps:
17+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4
18+
- name: Check for new PySide6 version
19+
id: check
20+
run: |
21+
CURRENT=$(grep -oP '^\s*PYSIDE_VERSION:\s*"\K[^"]+' .github/workflows/main.yml)
22+
LATEST=$(curl -s https://pypi.org/pypi/PySide6/json | jq -r .info.version)
23+
echo "current=$CURRENT" >> $GITHUB_OUTPUT
24+
echo "latest=$LATEST" >> $GITHUB_OUTPUT
25+
if [ "$CURRENT" != "$LATEST" ]; then
26+
echo "needs_bump=true" >> $GITHUB_OUTPUT
27+
fi
28+
- name: Check for existing PR
29+
if: steps.check.outputs.needs_bump == 'true'
30+
id: existing
31+
run: |
32+
if gh pr list --head "bump-pyside-${{ steps.check.outputs.latest }}" --json number --jq '.[0].number' | grep -q .; then
33+
echo "exists=true" >> $GITHUB_OUTPUT
34+
fi
35+
- name: Update version and create PR
36+
if: steps.check.outputs.needs_bump == 'true' && steps.existing.outputs.exists != 'true'
37+
run: |
38+
BRANCH="bump-pyside-${{ steps.check.outputs.latest }}"
39+
git checkout -b "$BRANCH"
40+
sed -i 's/PYSIDE_VERSION: ".*"/PYSIDE_VERSION: "${{ steps.check.outputs.latest }}"/' .github/workflows/main.yml
41+
git add .github/workflows/main.yml
42+
git config user.name "github-actions[bot]"
43+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
44+
git commit -m "Bump PySide6 to ${{ steps.check.outputs.latest }}"
45+
git push -u origin "$BRANCH"
46+
gh pr create \
47+
--title "Bump PySide6 to ${{ steps.check.outputs.latest }}" \
48+
--body "Automated bump from ${{ steps.check.outputs.current }} to ${{ steps.check.outputs.latest }}.
49+
50+
https://pypi.org/project/PySide6/${{ steps.check.outputs.latest }}/"

0 commit comments

Comments
 (0)