Skip to content

Commit 4ebcc3f

Browse files
committed
CI: upload gcc runtime DLLs as artifact; create-release downloads them
1 parent e67b442 commit 4ebcc3f

2 files changed

Lines changed: 49 additions & 0 deletions

File tree

.github/workflows/build-cache.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,12 @@ jobs:
7171
cp /mingw64/bin/libstdc++-6.dll libs/windows-x64/
7272
cp /mingw64/bin/libwinpthread-1.dll libs/windows-x64/
7373
cp /mingw64/bin/libssp-0.dll libs/windows-x64/ || true
74+
- name: Upload gcc runtime DLLs
75+
uses: actions/upload-artifact@v4
76+
with:
77+
name: windows-runtime-dlls
78+
path: libs/windows-x64/*.dll
79+
retention-days: 90
7480
- name: Build cache
7581
shell: msys2 {0}
7682
run: |

scripts/create-release.py

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,27 @@ def bump_version_files(tag):
7979
out.writelines(new_lines)
8080
print(f"Updated {path}: {pretty_key}={tag}, version bumped by 1")
8181

82+
def download_windows_dlls():
83+
"""Download bundled Windows runtime DLLs from latest CI run."""
84+
import subprocess, json
85+
repo = "processing-cpp/processing.cpp"
86+
r = subprocess.run(
87+
["gh", "run", "list", "--repo", repo, "--workflow", "build-cache.yml",
88+
"--status", "success", "--limit", "1", "--json", "databaseId"],
89+
capture_output=True, text=True)
90+
if r.returncode != 0: return
91+
run_id = json.loads(r.stdout)[0]["databaseId"]
92+
dest = Path(__file__).parent.parent / "libs" / "windows-x64"
93+
dest.mkdir(parents=True, exist_ok=True)
94+
result = subprocess.run(
95+
["gh", "run", "download", str(run_id), "--repo", repo,
96+
"--name", "windows-runtime-dlls", "--dir", str(dest)],
97+
capture_output=True, text=True)
98+
if result.returncode == 0:
99+
print(f" windows runtime DLLs downloaded to {dest}")
100+
else:
101+
print(f" WARNING: could not download windows runtime DLLs")
102+
82103
def trigger_and_wait_cache_build():
83104
"""Trigger a new build-cache CI run and wait for it to complete."""
84105
import subprocess, json, time
@@ -151,6 +172,27 @@ def download_cache_artifacts():
151172
print(f" {platform}: {files}")
152173

153174

175+
def download_windows_dlls():
176+
"""Download bundled Windows runtime DLLs from latest CI run."""
177+
import subprocess, json
178+
repo = "processing-cpp/processing.cpp"
179+
r = subprocess.run(
180+
["gh", "run", "list", "--repo", repo, "--workflow", "build-cache.yml",
181+
"--status", "success", "--limit", "1", "--json", "databaseId"],
182+
capture_output=True, text=True)
183+
if r.returncode != 0: return
184+
run_id = json.loads(r.stdout)[0]["databaseId"]
185+
dest = Path(__file__).parent.parent / "libs" / "windows-x64"
186+
dest.mkdir(parents=True, exist_ok=True)
187+
result = subprocess.run(
188+
["gh", "run", "download", str(run_id), "--repo", repo,
189+
"--name", "windows-runtime-dlls", "--dir", str(dest)],
190+
capture_output=True, text=True)
191+
if result.returncode == 0:
192+
print(f" windows runtime DLLs downloaded to {dest}")
193+
else:
194+
print(f" WARNING: could not download windows runtime DLLs")
195+
154196
def trigger_and_wait_cache_build():
155197
"""Trigger a new build-cache CI run and wait for it to complete."""
156198
import subprocess, json, time
@@ -189,6 +231,7 @@ def main():
189231
bump_version_files(version)
190232
trigger_and_wait_cache_build()
191233
download_cache_artifacts()
234+
download_windows_dlls()
192235
zip_name = "CppMode.zip"
193236
zip_path = os.path.join(OUTPUT_DIR, zip_name)
194237

0 commit comments

Comments
 (0)