bump-loopstructural-pin #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: bump-loopstructural-pin | |
| on: | |
| schedule: | |
| - cron: '0 6 * * 1' | |
| workflow_dispatch: {} | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| check-and-bump: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Get latest LoopStructural release | |
| id: latest | |
| run: | | |
| # LoopStructural is a release-please monorepo (LoopStructural itself, | |
| # plus loop_common/loop_interpolation sub-packages), so `releases/latest` | |
| # can return whichever component's release was published last, not | |
| # necessarily the LoopStructural package. Read the manifest instead — | |
| # it maps package name to version unambiguously. | |
| latest=$(curl -s https://raw.githubusercontent.com/Loop3D/LoopStructural/master/.release-please-manifest.json | jq -r '.["LoopStructural"]') | |
| echo "version=$latest" >> "$GITHUB_OUTPUT" | |
| - name: Bump pins if minor version changed | |
| id: bump | |
| run: | | |
| latest="${{ steps.latest.outputs.version }}" | |
| latest_minor="${latest%.*}" | |
| changed=0 | |
| for f in requirements/embedded.txt requirements/testing.txt; do | |
| current=$(grep -oP 'LoopStructural~=\K[0-9]+\.[0-9]+\.[0-9]+' "$f") | |
| current_minor="${current%.*}" | |
| if [ "$latest_minor" != "$current_minor" ]; then | |
| sed -i "s/LoopStructural~=[0-9.]\+/LoopStructural~=${latest}/" "$f" | |
| changed=1 | |
| fi | |
| done | |
| echo "changed=$changed" >> "$GITHUB_OUTPUT" | |
| - name: Open pull request | |
| if: steps.bump.outputs.changed == '1' | |
| uses: peter-evans/create-pull-request@v6 | |
| with: | |
| commit-message: "fix: bump LoopStructural pin to ${{ steps.latest.outputs.version }}" | |
| title: "Bump LoopStructural pin to ${{ steps.latest.outputs.version }}" | |
| body: | | |
| LoopStructural released a new minor version (${{ steps.latest.outputs.version }}). | |
| This bumps the `~=` pin in `requirements/embedded.txt` and | |
| `requirements/testing.txt` accordingly. | |
| Verify the `qgis-compat` CI job passes before merging. | |
| branch: bump-loopstructural-pin | |
| labels: dependencies |