|
| 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 }}/" |
0 commit comments