Skip to content

Commit e1127dc

Browse files
author
pepc84
committed
CI: upgrade to setup-java@v5
1 parent b63eb74 commit e1127dc

4 files changed

Lines changed: 130 additions & 7 deletions

File tree

.github/workflows/build-cache.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ jobs:
101101
BREW=$(brew --prefix)
102102
FLAGS="-std=c++2c -O2 -w -DPROCESSING_HAS_STB_IMAGE -DPROCESSING_HAS_STB_TRUETYPE -I src -I $BREW/include"
103103
104-
echo "Building Processing.o..."
105-
g++ $FLAGS -Wno-error -c src/Processing.cpp -o cache/macos-arm64/Processing.o || echo "WARNING: Processing.o build failed, skipping"
104+
# Processing.o skipped on macOS -- clang namespace issue;
105+
# it compiles inline at sketch build time instead.
106106
107107
echo "Building Processing_defaults.o..."
108108
g++ $FLAGS -Wno-error -c src/Processing_defaults.cpp -o cache/macos-arm64/Processing_defaults.o || echo "WARNING: defaults.o build failed, skipping"
@@ -130,8 +130,8 @@ jobs:
130130
BREW=$(brew --prefix)
131131
FLAGS="-std=c++2c -O2 -w -target x86_64-apple-macos10.13 -DPROCESSING_HAS_STB_IMAGE -DPROCESSING_HAS_STB_TRUETYPE -I src -I $BREW/include"
132132
133-
echo "Building Processing.o..."
134-
g++ $FLAGS -Wno-error -c src/Processing.cpp -o cache/macos-x64/Processing.o || echo "WARNING: Processing.o build failed, skipping"
133+
# Processing.o skipped on macOS -- clang namespace issue;
134+
# it compiles inline at sketch build time instead.
135135
136136
echo "Building Processing_defaults.o..."
137137
g++ $FLAGS -Wno-error -c src/Processing_defaults.cpp -o cache/macos-x64/Processing_defaults.o || echo "WARNING: defaults.o build failed, skipping"
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Bundle portable Windows gcc (MinGW-w64)
2+
3+
on:
4+
workflow_dispatch:
5+
6+
permissions:
7+
contents: write
8+
9+
jobs:
10+
bundle:
11+
runs-on: windows-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Download WinLibs portable gcc
16+
shell: powershell
17+
run: |
18+
$url = "https://github.com/brechtsanders/winlibs_mingw/releases/download/14.2.0posix-19.1.1-12.0.0-ucrt-r2/winlibs-x86_64-posix-seh-gcc-14.2.0-mingw-w64ucrt-12.0.0-r2.zip"
19+
Write-Host "Downloading WinLibs gcc..."
20+
Invoke-WebRequest -Uri $url -OutFile gcc.zip -UseBasicParsing
21+
Write-Host "Extracting..."
22+
Expand-Archive gcc.zip -DestinationPath gcc_extracted
23+
24+
- name: Extract minimal toolchain
25+
shell: powershell
26+
run: |
27+
# We only need the compiler and its immediate runtime deps.
28+
# Full mingw64 is ~700MB -- extract just what's needed to compile.
29+
$src = "gcc_extracted\mingw64"
30+
$dst = "libs\windows-x64\gcc"
31+
New-Item -ItemType Directory -Force -Path $dst
32+
33+
# Essential compiler binaries
34+
$bins = @("g++.exe", "gcc.exe", "as.exe", "ld.exe", "windres.exe",
35+
"cpp.exe", "cc1.exe", "cc1plus.exe", "collect2.exe",
36+
"libgcc_s_seh-1.dll", "libstdc++-6.dll", "libwinpthread-1.dll",
37+
"libgomp-1.dll")
38+
foreach ($b in $bins) {
39+
$f = Get-ChildItem -Path $src -Recurse -Filter $b -ErrorAction SilentlyContinue | Select-Object -First 1
40+
if ($f) { Copy-Item $f.FullName -Destination $dst; Write-Host "Copied $b" }
41+
}
42+
43+
# Runtime libraries needed by compiled sketches
44+
Copy-Item "$src\bin\libgcc_s_seh-1.dll" $dst -ErrorAction SilentlyContinue
45+
Copy-Item "$src\bin\libstdc++-6.dll" $dst -ErrorAction SilentlyContinue
46+
Copy-Item "$src\bin\libwinpthread-1.dll" $dst -ErrorAction SilentlyContinue
47+
48+
# Include dirs (needed at compile time)
49+
Copy-Item "$src\include" "$dst\include" -Recurse -Force
50+
Copy-Item "$src\lib\gcc" "$dst\lib\gcc" -Recurse -Force
51+
Copy-Item "$src\lib\libstdc++*" "$dst\lib\" -Force -ErrorAction SilentlyContinue
52+
Copy-Item "$src\lib\libgcc*" "$dst\lib\" -Force -ErrorAction SilentlyContinue
53+
Copy-Item "$src\lib\libwinpthread*" "$dst\lib\" -Force -ErrorAction SilentlyContinue
54+
Copy-Item "$src\lib\crt*" "$dst\lib\" -Force -ErrorAction SilentlyContinue
55+
56+
Write-Host "Done. Size:"
57+
(Get-ChildItem $dst -Recurse | Measure-Object -Property Length -Sum).Sum / 1MB
58+
59+
- name: Commit to repo
60+
shell: powershell
61+
run: |
62+
git config user.name "github-actions[bot]"
63+
git config user.email "github-actions[bot]@users.noreply.github.com"
64+
git add libs/windows-x64/gcc/
65+
git diff --staged --quiet
66+
if ($LASTEXITCODE -ne 0) {
67+
git commit -m "ci: bundle portable MinGW-w64 gcc for Windows"
68+
git push
69+
} else {
70+
Write-Host "No changes to commit"
71+
}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Bundle Windows GLFW+GLEW headers and libs
2+
3+
on:
4+
workflow_dispatch:
5+
6+
permissions:
7+
contents: write
8+
9+
jobs:
10+
build:
11+
runs-on: windows-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Install MinGW and get GLFW/GLEW
16+
uses: msys2/setup-msys2@v2
17+
with:
18+
msystem: MINGW64
19+
install: mingw-w64-x86_64-glfw mingw-w64-x86_64-glew
20+
21+
- name: Copy headers and import libs
22+
shell: msys2 {0}
23+
run: |
24+
mkdir -p libs/windows-x64/include/GLFW
25+
mkdir -p libs/windows-x64/include/GL
26+
27+
# GLFW headers
28+
cp /mingw64/include/GLFW/*.h libs/windows-x64/include/GLFW/
29+
30+
# GLEW headers
31+
cp /mingw64/include/GL/glew.h libs/windows-x64/include/GL/
32+
cp /mingw64/include/GL/wglew.h libs/windows-x64/include/GL/ 2>/dev/null || true
33+
34+
# Import libs (needed at link time)
35+
cp /mingw64/lib/libglfw3.a libs/windows-x64/ 2>/dev/null || true
36+
cp /mingw64/lib/libglfw3dll.a libs/windows-x64/ 2>/dev/null || true
37+
cp /mingw64/lib/libglew32.dll.a libs/windows-x64/ 2>/dev/null || true
38+
cp /mingw64/lib/libglew32.a libs/windows-x64/ 2>/dev/null || true
39+
40+
echo "=== Headers ==="
41+
find libs/windows-x64/include -name "*.h"
42+
echo "=== Libs ==="
43+
ls -lh libs/windows-x64/*.a 2>/dev/null || echo "no .a files"
44+
45+
- name: Commit to repo
46+
shell: bash
47+
run: |
48+
git config user.name "github-actions[bot]"
49+
git config user.email "github-actions[bot]@users.noreply.github.com"
50+
git add libs/windows-x64/
51+
git diff --staged --quiet || git commit -m "ci: add bundled GLFW+GLEW headers and import libs for Windows"
52+
git push

.github/workflows/integration-test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
sudo apt-get install -y g++ libglfw3-dev libglew-dev
2020
2121
- name: Set up Java 21
22-
uses: actions/setup-java@v4
22+
uses: actions/setup-java@v5
2323
with:
2424
java-version: '21'
2525
distribution: 'temurin'
@@ -57,7 +57,7 @@ jobs:
5757
- uses: actions/checkout@v4
5858

5959
- name: Set up Java 21
60-
uses: actions/setup-java@v4
60+
uses: actions/setup-java@v5
6161
with:
6262
java-version: '21'
6363
distribution: 'temurin'
@@ -103,7 +103,7 @@ jobs:
103103
- uses: actions/checkout@v4
104104

105105
- name: Set up Java 21
106-
uses: actions/setup-java@v4
106+
uses: actions/setup-java@v5
107107
with:
108108
java-version: '21'
109109
distribution: 'temurin'

0 commit comments

Comments
 (0)