@@ -31,127 +31,29 @@ jobs:
3131 check-updates :
3232 runs-on : ubuntu-latest
3333 outputs :
34- rust_current : ${{ steps.current .outputs.rust }}
35- rust_latest : ${{ steps.latest .outputs.rust }}
36- llvm_current : ${{ steps.current .outputs.llvm }}
37- llvm_latest : ${{ steps.latest .outputs.llvm }}
38- llvm_major : ${{ steps.latest .outputs.llvm_major }}
39- git_current : ${{ steps.current .outputs.git }}
40- git_latest : ${{ steps.latest .outputs.git }}
41- sevenzip_current : ${{ steps.current .outputs.sevenzip }}
42- sevenzip_latest : ${{ steps.latest .outputs.sevenzip }}
43- has_update : ${{ steps.compare .outputs.has_update }}
44- update_summary : ${{ steps.compare .outputs.summary }}
34+ rust_current : ${{ steps.check .outputs.rust_current }}
35+ rust_latest : ${{ steps.check .outputs.rust_latest }}
36+ llvm_current : ${{ steps.check .outputs.llvm_current }}
37+ llvm_latest : ${{ steps.check .outputs.llvm_latest }}
38+ llvm_major : ${{ steps.check .outputs.llvm_major }}
39+ git_current : ${{ steps.check .outputs.git_current }}
40+ git_latest : ${{ steps.check .outputs.git_latest }}
41+ sevenzip_current : ${{ steps.check .outputs.sevenzip_current }}
42+ sevenzip_latest : ${{ steps.check .outputs.sevenzip_latest }}
43+ has_update : ${{ steps.check .outputs.has_update }}
44+ summary : ${{ steps.check .outputs.summary }}
4545 steps :
4646 - uses : actions/checkout@v4
4747
48- - name : Get current versions from Dockerfiles
49- id : current
50- run : |
51- # Get from linux/Dockerfile
52- RUST=$(grep -oP 'RUST_VERSION=\K[0-9.]+' linux/Dockerfile | head -1)
53- LLVM_MAJOR=$(grep -oP 'LLVM_VERSION=\K[0-9]+' linux/Dockerfile | head -1)
54-
55- # Get from windows/Dockerfile (full LLVM version)
56- LLVM=$(grep -oP 'LLVM_VERSION=\K[0-9.]+' windows/Dockerfile | head -1)
57- GIT=$(grep -oP 'GIT_VERSION=\K[0-9.]+' windows/Dockerfile | head -1)
58- ZIP=$(grep -oP '7ZIP_VERSION=\K[0-9]+' windows/Dockerfile | head -1)
59-
60- echo "rust=$RUST" >> $GITHUB_OUTPUT
61- echo "llvm=$LLVM" >> $GITHUB_OUTPUT
62- echo "llvm_major=$LLVM_MAJOR" >> $GITHUB_OUTPUT
63- echo "git=$GIT" >> $GITHUB_OUTPUT
64- echo "sevenzip=$ZIP" >> $GITHUB_OUTPUT
65-
66- echo "Current versions:"
67- echo " Rust: $RUST"
68- echo " LLVM: $LLVM (major: $LLVM_MAJOR)"
69- echo " Git: $GIT"
70- echo " 7-Zip: $ZIP"
71-
72- - name : Get latest versions
73- id : latest
48+ - name : Check for updates
49+ id : check
7450 env :
7551 GH_TOKEN : ${{ github.token }}
76- run : |
77- # Rust - from official manifest
78- if [ -n "${{ inputs.rust_version }}" ]; then
79- RUST="${{ inputs.rust_version }}"
80- else
81- RUST=$(curl -s https://static.rust-lang.org/dist/channel-rust-stable.toml | grep -oP 'cargo-\K[0-9]+\.[0-9]+\.[0-9]+' | head -1)
82- fi
83- echo "rust=$RUST" >> $GITHUB_OUTPUT
84- echo "Latest Rust: $RUST"
85-
86- # LLVM - from ghaith/llvm-package-windows releases
87- if [ -n "${{ inputs.llvm_version }}" ]; then
88- LLVM="${{ inputs.llvm_version }}"
89- else
90- LLVM=$(gh api repos/ghaith/llvm-package-windows/releases/latest --jq '.tag_name' | sed 's/^v//')
91- fi
92- LLVM_MAJOR=$(echo "$LLVM" | grep -oP '^\d+')
93- echo "llvm=$LLVM" >> $GITHUB_OUTPUT
94- echo "llvm_major=$LLVM_MAJOR" >> $GITHUB_OUTPUT
95- echo "Latest LLVM: $LLVM (major: $LLVM_MAJOR)"
96-
97- # Git for Windows - from GitHub releases
98- if [ -n "${{ inputs.git_version }}" ]; then
99- GIT="${{ inputs.git_version }}"
100- else
101- GIT=$(gh api repos/git-for-windows/git/releases/latest --jq '.tag_name' | grep -oP '[0-9]+\.[0-9]+\.[0-9]+')
102- fi
103- echo "git=$GIT" >> $GITHUB_OUTPUT
104- echo "Latest Git: $GIT"
105-
106- # 7-Zip - scrape from download page (version code like 2600 for 26.00)
107- if [ -n "${{ inputs.sevenzip_version }}" ]; then
108- ZIP="${{ inputs.sevenzip_version }}"
109- else
110- ZIP=$(curl -s https://www.7-zip.org/download.html | grep -oP '7z\K[0-9]{4}(?=-x64\.exe)' | head -1)
111- fi
112- echo "sevenzip=$ZIP" >> $GITHUB_OUTPUT
113- echo "Latest 7-Zip: $ZIP"
114-
115- - name : Compare versions
116- id : compare
117- run : |
118- UPDATES=""
119- HAS_UPDATE=false
120-
121- # Only Rust and LLVM updates trigger a rebuild
122- if [ "${{ steps.current.outputs.rust }}" != "${{ steps.latest.outputs.rust }}" ]; then
123- UPDATES="${UPDATES}- Rust: ${{ steps.current.outputs.rust }} → ${{ steps.latest.outputs.rust }}\n"
124- HAS_UPDATE=true
125- fi
126-
127- if [ "${{ steps.current.outputs.llvm }}" != "${{ steps.latest.outputs.llvm }}" ]; then
128- UPDATES="${UPDATES}- LLVM: ${{ steps.current.outputs.llvm }} → ${{ steps.latest.outputs.llvm }}\n"
129- HAS_UPDATE=true
130- fi
131-
132- # Git and 7-Zip are updated opportunistically (only if we're already rebuilding)
133- if [ "$HAS_UPDATE" = true ]; then
134- if [ "${{ steps.current.outputs.git }}" != "${{ steps.latest.outputs.git }}" ]; then
135- UPDATES="${UPDATES}- Git: ${{ steps.current.outputs.git }} → ${{ steps.latest.outputs.git }}\n"
136- fi
137-
138- if [ "${{ steps.current.outputs.sevenzip }}" != "${{ steps.latest.outputs.sevenzip }}" ]; then
139- UPDATES="${UPDATES}- 7-Zip: ${{ steps.current.outputs.sevenzip }} → ${{ steps.latest.outputs.sevenzip }}\n"
140- fi
141- fi
142-
143- if [ "$HAS_UPDATE" = true ]; then
144- echo "has_update=true" >> $GITHUB_OUTPUT
145- echo -e "Updates available:\n$UPDATES"
146- else
147- echo "has_update=false" >> $GITHUB_OUTPUT
148- echo "All versions are up to date"
149- fi
150-
151- # Store summary for PR body (escape newlines for GitHub Actions)
152- echo "summary<<EOF" >> $GITHUB_OUTPUT
153- echo -e "$UPDATES" >> $GITHUB_OUTPUT
154- echo "EOF" >> $GITHUB_OUTPUT
52+ RUST_OVERRIDE : ${{ inputs.rust_version }}
53+ LLVM_OVERRIDE : ${{ inputs.llvm_version }}
54+ GIT_OVERRIDE : ${{ inputs.git_version }}
55+ SEVENZIP_OVERRIDE : ${{ inputs.sevenzip_version }}
56+ run : ./scripts/check-versions.sh
15557
15658 create-pr :
15759 needs : check-updates
@@ -160,65 +62,22 @@ jobs:
16062 steps :
16163 - uses : actions/checkout@v4
16264
163- - name : Update versions in Dockerfiles
164- run : |
165- echo "Applying version updates..."
166-
167- # Update Rust in both Dockerfiles
168- if [ "${{ needs.check-updates.outputs.rust_current }}" != "${{ needs.check-updates.outputs.rust_latest }}" ]; then
169- sed -i "s/RUST_VERSION=${{ needs.check-updates.outputs.rust_current }}/RUST_VERSION=${{ needs.check-updates.outputs.rust_latest }}/" linux/Dockerfile windows/Dockerfile
170- echo "Updated Rust to ${{ needs.check-updates.outputs.rust_latest }}"
171- fi
172-
173- # Update LLVM in windows/Dockerfile (full version)
174- if [ "${{ needs.check-updates.outputs.llvm_current }}" != "${{ needs.check-updates.outputs.llvm_latest }}" ]; then
175- sed -i "s/LLVM_VERSION=${{ needs.check-updates.outputs.llvm_current }}/LLVM_VERSION=${{ needs.check-updates.outputs.llvm_latest }}/" windows/Dockerfile
176- # Update major version in linux/Dockerfile
177- OLD_MAJOR=$(echo "${{ needs.check-updates.outputs.llvm_current }}" | grep -oP '^\d+')
178- NEW_MAJOR="${{ needs.check-updates.outputs.llvm_major }}"
179- if [ "$OLD_MAJOR" != "$NEW_MAJOR" ]; then
180- sed -i "s/LLVM_VERSION=$OLD_MAJOR/LLVM_VERSION=$NEW_MAJOR/" linux/Dockerfile
181- echo "Updated Linux LLVM major to $NEW_MAJOR"
182- fi
183- echo "Updated Windows LLVM to ${{ needs.check-updates.outputs.llvm_latest }}"
184- fi
185-
186- # Update Git in windows/Dockerfile
187- if [ "${{ needs.check-updates.outputs.git_current }}" != "${{ needs.check-updates.outputs.git_latest }}" ]; then
188- sed -i "s/GIT_VERSION=${{ needs.check-updates.outputs.git_current }}/GIT_VERSION=${{ needs.check-updates.outputs.git_latest }}/" windows/Dockerfile
189- echo "Updated Git to ${{ needs.check-updates.outputs.git_latest }}"
190- fi
191-
192- # Update 7-Zip in windows/Dockerfile
193- if [ "${{ needs.check-updates.outputs.sevenzip_current }}" != "${{ needs.check-updates.outputs.sevenzip_latest }}" ]; then
194- sed -i "s/7ZIP_VERSION=${{ needs.check-updates.outputs.sevenzip_current }}/7ZIP_VERSION=${{ needs.check-updates.outputs.sevenzip_latest }}/" windows/Dockerfile
195- echo "Updated 7-Zip to ${{ needs.check-updates.outputs.sevenzip_latest }}"
196- fi
197-
198- echo ""
199- echo "Updated Dockerfiles:"
200- grep -E '(RUST_VERSION|LLVM_VERSION|GIT_VERSION|7ZIP_VERSION)=' linux/Dockerfile windows/Dockerfile
65+ - name : Update Dockerfiles
66+ env :
67+ RUST_CURRENT : ${{ needs.check-updates.outputs.rust_current }}
68+ RUST_LATEST : ${{ needs.check-updates.outputs.rust_latest }}
69+ LLVM_CURRENT : ${{ needs.check-updates.outputs.llvm_current }}
70+ LLVM_LATEST : ${{ needs.check-updates.outputs.llvm_latest }}
71+ LLVM_MAJOR : ${{ needs.check-updates.outputs.llvm_major }}
72+ GIT_CURRENT : ${{ needs.check-updates.outputs.git_current }}
73+ GIT_LATEST : ${{ needs.check-updates.outputs.git_latest }}
74+ SEVENZIP_CURRENT : ${{ needs.check-updates.outputs.sevenzip_current }}
75+ SEVENZIP_LATEST : ${{ needs.check-updates.outputs.sevenzip_latest }}
76+ run : ./scripts/update-versions.sh
20177
20278 - name : Validate URLs
20379 run : ./scripts/validate-urls.sh
20480
205- - name : Generate branch name and tag
206- id : meta
207- run : |
208- # Branch name based on what's being updated
209- BRANCH="update-deps"
210-
211- # Tag is based on LLVM major and Rust major.minor
212- LLVM_MAJOR="${{ needs.check-updates.outputs.llvm_major }}"
213- RUST="${{ needs.check-updates.outputs.rust_latest }}"
214- RUST_MAJOR_MINOR=$(echo "$RUST" | grep -oP '^\d+\.\d+')
215-
216- TAG="v${LLVM_MAJOR}-${RUST_MAJOR_MINOR}"
217-
218- echo "branch=$BRANCH" >> $GITHUB_OUTPUT
219- echo "tag=$TAG" >> $GITHUB_OUTPUT
220- echo "Branch: $BRANCH, Tag: $TAG"
221-
22281 - name : Create Pull Request
22382 uses : peter-evans/create-pull-request@v6
22483 with :
22887 body : |
22988 This PR updates the following dependencies:
23089
231- ${{ needs.check-updates.outputs.update_summary }}
90+ ${{ needs.check-updates.outputs.summary }}
23291
23392 ## Updated versions
23493 | Component | Version |
@@ -240,11 +99,11 @@ jobs:
24099 | 7-Zip | ${{ needs.check-updates.outputs.sevenzip_latest }} |
241100
242101 ## Release
243- When merged, this will be tagged as `${{ steps.meta .outputs.tag }}`.
102+ When merged, this will be tagged as `v ${{ needs.check-updates .outputs.llvm_major }}-${{ needs.check-updates.outputs.rust_latest }}`.
244103
245104 ---
246105 *This PR was automatically created by the update-versions workflow.*
247- branch : ${{ steps.meta.outputs.branch }}
106+ branch : update-deps
248107 delete-branch : true
249108 labels : |
250109 dependencies
0 commit comments