Use CPack for Windows packaging

This commit is contained in:
vulcandth
2026-03-08 21:14:34 -05:00
committed by Eldred Habert
parent 2cfb2b2533
commit c3b47abcc8
6 changed files with 62 additions and 23 deletions
+2 -1
View File
@@ -21,7 +21,8 @@ case "${1%-*}" in
pkg install -y bash bison cmake git png
;;
windows)
choco install -y winflexbison3
# GitHub Actions' hosted runners ship CMake 3.x, but versions prior to 4.0.0 ignore `CPACK_PACKAGE_FILE_NAME`.
choco install -y winflexbison3 cmake
# The below expects the base name, not the Windows-specific name.
bison() { win_bison "$@"; } # An alias doesn't work, so we use a function instead.
;;
@@ -24,11 +24,6 @@ jobs:
strategy:
matrix:
bits: [32, 64]
include:
- bits: 32
arch: x86
- bits: 64
arch: x86_x64
fail-fast: false
steps:
- name: Checkout repo
@@ -42,14 +37,14 @@ jobs:
cmake -S . -B build --preset msvc${{ matrix.bits }} -DFETCHCONTENT_BASE_DIR="${{ env.DEPS_ROOT_DIR }}"
cmake --build build --config Release
- name: Package binaries
working-directory: build
run: |
cmake --install build --config Release --prefix install_dir --verbose
Compress-Archive -LiteralPath @("install_dir/bin/rgbasm.exe", "install_dir/bin/rgblink.exe", "install_dir/bin/rgbfix.exe", "install_dir/bin/rgbgfx.exe", "install_dir/bin/z.dll", "install_dir/bin/libpng16.dll") "rgbds-win${{ matrix.bits }}.zip"
cpack -DCPACK_PACKAGE_FILE_NAME=rgbds-win${{ matrix.bits }} -G ZIP -C Release --verbose
- name: Upload Windows binaries
uses: actions/upload-artifact@v7
with:
name: win${{ matrix.bits }}
path: rgbds-win${{ matrix.bits }}.zip
path: build/rgbds-win${{ matrix.bits }}.zip
if-no-files-found: error
macos:
+3 -12
View File
@@ -155,11 +155,6 @@ jobs:
matrix:
bits: [32, 64]
os: [windows-2022, windows-2025]
include:
- bits: 32
arch: x86
- bits: 64
arch: x86_x64
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
@@ -175,21 +170,19 @@ jobs:
key: dep-srcs-${{ hashFiles('cmake/deps.cmake') }}
enableCrossOsArchive: true # Currently only used on Windows, but the contents are OS-agnostic.
- name: Build Windows binaries
shell: bash
run: | # ASan seems to be broken on Windows, so we disable it.
cmake -S . -B build --preset develop-msvc${{ matrix.bits }} -DFETCHCONTENT_BASE_DIR="${{ env.DEPS_ROOT_DIR }}" -DSANITIZERS=OFF
cmake --build build
- name: Package binaries
working-directory: build
shell: bash
run: |
cmake --install build --config Debug --prefix install_dir --verbose
mkdir bins
cp -v install_dir/bin/{rgb*.exe,*.dll} bins
cpack -DCPACK_PACKAGE_FILE_NAME=rgbds-win${{ matrix.bits }} -G ZIP -C Debug --verbose
- name: Upload Windows binaries
uses: actions/upload-artifact@v7
with:
name: rgbds-canary-w${{ matrix.bits }}-${{ matrix.os }}
path: bins
path: build/rgbds-win${{ matrix.bits }}.zip
if-no-files-found: error
- name: Compute test dependency cache params
id: test-deps-cache-params
@@ -218,8 +211,6 @@ jobs:
- name: Run tests
shell: bash
run: |
cp bins/* .
cp bins/*.dll test/gfx
test/run-tests.sh --os ${{ matrix.os }}
windows-mingw-build: