Use the recommended ghactions action to set up msys2

This commit is contained in:
Tamás Bálint Misius 2024-02-21 11:13:18 +01:00
parent 0310ac08a8
commit 79f45eb096
No known key found for this signature in database
GPG Key ID: 5B472A12F6ECA9F2
4 changed files with 41 additions and 17 deletions

1
.github/build.sh vendored
View File

@ -76,6 +76,7 @@ if [[ -z ${BSH_NO_PACKAGES-} ]]; then
else
pacman -S --noconfirm --needed mingw-w64-ucrt-x86_64-{pkgconf,bzip2,luajit,jsoncpp,curl,SDL2,libpng,meson,fftw}
fi
export PKG_CONFIG=$(which pkg-config.exe)
fi
;;
linux)

View File

@ -1,10 +0,0 @@
set -euo pipefail
IFS=$'\t\n'
echo 'C:\msys64\ucrt64\bin' >> tmp
echo 'C:\msys64\usr\bin' >> tmp
cat $GITHUB_PATH >> tmp
mv tmp $GITHUB_PATH
echo "MSYSTEM=UCRT64" >> $GITHUB_ENV
echo "PKG_CONFIG="'C:\msys64\ucrt64\bin\pkg-config.exe' >> $GITHUB_ENV

7
.github/prepare.py vendored
View File

@ -173,6 +173,10 @@ for arch, platform, libc, statdyn, bplatform, runso
debug_asset_path = f'{app_name_slug}-{arch}.AppImage.dbg'
debug_asset_name = f'{app_name_slug}-{arch}.AppImage.dbg'
starcatcher_name = f'powder-{release_name}-{starcatcher}{suffix}'
msys2_bash = (bplatform == 'windows' and libc == 'mingw')
shell = 'bash'
if msys2_bash:
shell = 'msys2 {0}'
build_matrix.append({
'bsh_build_platform': bplatform, # part of the unique portion of the matrix
'bsh_host_arch': arch, # part of the unique portion of the matrix
@ -181,7 +185,7 @@ for arch, platform, libc, statdyn, bplatform, runso
'bsh_static_dynamic': statdyn, # part of the unique portion of the matrix
'bsh_debug_release': dbgrel, # part of the unique portion of the matrix
'runs_on': runson,
'force_msys2_bash': (bplatform == 'windows' and libc == 'mingw') and 'yes' or 'no',
'force_msys2_bash': msys2_bash and 'yes' or 'no',
'package_suffix': suffix,
'package_mode': mode,
'publish': publish and 'yes' or 'no',
@ -192,6 +196,7 @@ for arch, platform, libc, statdyn, bplatform, runso
'debug_asset_path': debug_asset_path,
'debug_asset_name': debug_asset_name,
'job_name': job_name,
'shell': shell,
})
if publish:
publish_matrix.append({

View File

@ -54,17 +54,45 @@ jobs:
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.prepare.outputs.build_matrix) }}
defaults:
run:
shell: ${{ matrix.shell }}
steps:
- if: matrix.force_msys2_bash == 'yes'
uses: msys2/setup-msys2@v2
with:
msystem: UCRT64
update: true
path-type: strict
cache: true
# this list doesn't have to mirror the one in build.sh perfectly
# but the packages listed here get cached properly and take less time to install
install: >-
git
curl
mingw-w64-ucrt-x86_64-gcc
mingw-w64-ucrt-x86_64-pkgconf
mingw-w64-ucrt-x86_64-bzip2
mingw-w64-ucrt-x86_64-luajit
mingw-w64-ucrt-x86_64-jsoncpp
mingw-w64-ucrt-x86_64-curl
mingw-w64-ucrt-x86_64-SDL2
mingw-w64-ucrt-x86_64-libpng
mingw-w64-ucrt-x86_64-meson
mingw-w64-ucrt-x86_64-python
mingw-w64-ucrt-x86_64-python-pip
mingw-w64-ucrt-x86_64-fftw
mingw-w64-ucrt-x86_64-cmake
mingw-w64-ucrt-x86_64-7zip
patch
- run: git config --global core.autocrlf false
- uses: actions/checkout@v4
- if: matrix.force_msys2_bash == 'yes'
run: bash -c './.github/force-msys2-bash.sh'
- if: matrix.force_msys2_bash == 'yes'
run: bash -c 'pacman -Syu --noconfirm'
- uses: actions/setup-python@v5
- if: matrix.force_msys2_bash != 'yes'
uses: actions/setup-python@v5
with:
python-version: '3.10'
- run: python -m pip install meson==1.2.3 ninja # TODO: go back to using latest meson once https://github.com/mesonbuild/meson/pull/12544 is live
- if: matrix.force_msys2_bash != 'yes'
run: python -m pip install meson==1.2.3 ninja # TODO: go back to using latest meson once https://github.com/mesonbuild/meson/pull/12544 is live
- if: matrix.bsh_build_platform == 'darwin'
run: brew install bash coreutils
- run: bash -c './.github/build.sh'