-
Notifications
You must be signed in to change notification settings - Fork 1
58 lines (51 loc) · 2.2 KB
/
Copy pathbump-loopstructural-pin.yml
File metadata and controls
58 lines (51 loc) · 2.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
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