Skip to content

Commit 6229272

Browse files
committed
ci: Hardcode+auto-update PySide6 version
1 parent cfd2d5b commit 6229272

3 files changed

Lines changed: 61 additions & 11 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=$(cat .pyside-version)
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+
echo "${{ steps.check.outputs.latest }}" > .pyside-version
41+
git add .pyside-version
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 "ci: 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 }}/"

.github/workflows/main.yml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,15 @@ jobs:
44
name: Build sdist
55
runs-on: ubuntu-latest
66
outputs:
7-
rel0: ${{ steps.query.outputs.rel0 }}
7+
pyside_ver: ${{ steps.version.outputs.pyside_ver }}
88
steps:
99
- name: Checkout
1010
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4
1111
with:
1212
submodules: recursive
13-
- name: Query PyPI for recent PySide release number
14-
id: query
15-
run: |
16-
echo "rel0=$(curl -s https://pypi.org/pypi/PySide6/json | jq -r .info.version)" >> $GITHUB_OUTPUT
13+
- name: Set PySide version
14+
id: version
15+
run: echo "pyside_ver=$(cat .pyside-version)" >> $GITHUB_OUTPUT
1716
- name: Build sdist
1817
env:
1918
PYSIDE6_QTADS_NO_HARD_PYSIDE_REQUIREMENT: 1
@@ -35,23 +34,23 @@ jobs:
3534
matrix:
3635
include:
3736
- os: windows-latest
38-
pyside_ver: ${{ needs.build_src.outputs.rel0 }}
37+
pyside_ver: ${{ needs.build_src.outputs.pyside_ver }}
3938
wheel: cp310-win_amd64
4039
arch: x86_64
4140
- os: windows-11-arm
42-
pyside_ver: ${{ needs.build_src.outputs.rel0 }}
41+
pyside_ver: ${{ needs.build_src.outputs.pyside_ver }}
4342
wheel: cp310-win_arm64
4443
arch: arm64
4544
- os: ubuntu-latest
46-
pyside_ver: ${{ needs.build_src.outputs.rel0 }}
45+
pyside_ver: ${{ needs.build_src.outputs.pyside_ver }}
4746
wheel: cp310-manylinux_x86_64
4847
arch: x86_64
4948
- os: macos-15-intel
50-
pyside_ver: ${{ needs.build_src.outputs.rel0 }}
49+
pyside_ver: ${{ needs.build_src.outputs.pyside_ver }}
5150
wheel: cp310-macosx_x86_64
5251
arch: x86_64
5352
- os: macos-latest
54-
pyside_ver: ${{ needs.build_src.outputs.rel0 }}
53+
pyside_ver: ${{ needs.build_src.outputs.pyside_ver }}
5554
wheel: cp310-macosx_arm64
5655
arch: arm64
5756
steps:
@@ -162,7 +161,7 @@ jobs:
162161
matrix:
163162
include:
164163
- os: ubuntu-24.04-arm
165-
pyside_ver: ${{ needs.build_src.outputs.rel0 }}
164+
pyside_ver: ${{ needs.build_src.outputs.pyside_ver }}
166165
wheel: cp310-manylinux_aarch64
167166
arch: aarch64
168167
runs-on: ${{ matrix.os }}

.pyside-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
6.11.0

0 commit comments

Comments
 (0)