|
36 | 36 | release_extension: ".tar.xz", |
37 | 37 | archive_command: "tar cvfJ" |
38 | 38 | } |
| 39 | + - { |
| 40 | + name: "Ubuntu MinGW Cross-Compile", |
| 41 | + os: ubuntu-latest, |
| 42 | + mingw_cross: true, |
| 43 | + release_name: "win-x86_64-ubuntu-mingw", |
| 44 | + release_extension: ".zip", |
| 45 | + archive_command: "zip -r" |
| 46 | + } |
39 | 47 | - { |
40 | 48 | name: "MSYS2 MINGW64 GCC", |
41 | 49 | os: windows-latest, |
@@ -160,13 +168,25 @@ jobs: |
160 | 168 | run: | |
161 | 169 | echo "C:\msys64\mingw64\bin" >> $GITHUB_PATH |
162 | 170 |
|
| 171 | + - name: Install MinGW cross-compiler |
| 172 | + if: matrix.config.mingw_cross == true |
| 173 | + run: | |
| 174 | + sudo apt-get update |
| 175 | + sudo apt-get install -y mingw-w64 zip |
| 176 | +
|
163 | 177 | - name: Make buildjsonc.sh executable |
164 | 178 | if: matrix.config.vm_actions != true && matrix.config.msys2_msystem == '' |
165 | 179 | run: chmod +x Make/buildjsonc.sh |
166 | 180 |
|
167 | | - # Traditional make builds (Windows/Ubuntu) |
| 181 | + # Ubuntu MinGW cross-compile build |
| 182 | + - name: make (MinGW cross-compile) |
| 183 | + if: matrix.config.mingw_cross == true |
| 184 | + run: | |
| 185 | + make BUILD_TYPE=release CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ |
| 186 | +
|
| 187 | + # Traditional make builds (Windows/Ubuntu native) |
168 | 188 | - name: make |
169 | | - if: matrix.config.vm_actions != true && matrix.config.msys2_msystem == '' |
| 189 | + if: matrix.config.vm_actions != true && matrix.config.msys2_msystem == '' && matrix.config.mingw_cross != true |
170 | 190 | run: | |
171 | 191 | make BUILD_TYPE=release |
172 | 192 |
|
@@ -244,7 +264,7 @@ jobs: |
244 | 264 | usesh: true |
245 | 265 | prepare: | |
246 | 266 | pkg update || true |
247 | | - pkg install -y curl gmake bash |
| 267 | + pkg install -y curl gmake bash gcc |
248 | 268 | /usr/sbin/dntpd -s |
249 | 269 |
|
250 | 270 | run: | |
@@ -295,21 +315,22 @@ jobs: |
295 | 315 | env: |
296 | 316 | ARCHIVE_EXT: ${{ matrix.config.release_extension }} |
297 | 317 | run: | |
298 | | - mkdir -p build/package |
299 | | - # Find the bin directory (target triplet varies by platform) |
| 318 | + # Find the bin directory and copy to DESTDIR for packaging |
300 | 319 | BIN_DIR=$(find build -type d -name bin | head -n 1) |
301 | 320 | if [ -z "$BIN_DIR" ]; then |
302 | 321 | echo "Error: No bin directory found in build/" |
303 | 322 | exit 1 |
304 | 323 | fi |
305 | 324 | echo "Found executables in: $BIN_DIR" |
306 | | - cd "${BIN_DIR}" |
307 | | - ${{ matrix.config.archive_command }} "../../build/package/${DESTDIR}${ARCHIVE_EXT}" . |
308 | 325 |
|
309 | | - - name: Uploading artifacts |
310 | | - uses: actions/upload-artifact@v6.0.0 |
311 | | - with: |
| 326 | + # Copy binaries to a clean directory for packaging (matches meson approach) |
| 327 | + mkdir -p "build/${DESTDIR}" |
| 328 | + cp -r "${BIN_DIR}"/* "build/${DESTDIR}/" |
| 329 | +
|
| 330 | + # Create archive from build directory (simpler, matches meson.yml) |
| 331 | + cd build |
| 332 | + ${{ matrix.config.archive_command }} "${DESTDIR}${ARCHIVE_EXT}" "${DESTDIR}" |
312 | 333 | name: ${{ format('{0}', env.DESTDIR) }} |
313 | | - path: ${{ format('./build/package/{0}{1}', env.DESTDIR, matrix.config.release_extension) }} |
| 334 | + path: ${{ format('./build/{0}{1}', env.DESTDIR, matrix.config.release_extension) }} |
314 | 335 |
|
315 | 336 | # Not packaging release from make since this comes from meson instead. This CI is meant to check that we preserve compatibility with older make systems as a backup only. |
0 commit comments