Add MSYS2 CI
All checks were successful
Build and Deploy / build-linux (push) Successful in 36s
Build and Deploy / build-windows (CLANG64) (push) Successful in 6m12s
Build and Deploy / package-dist (push) Has been skipped
Build and Deploy / deploy-itch (push) Has been skipped
Build and Deploy / deploy-gitea (push) Has been skipped

This commit is contained in:
2025-02-20 11:13:00 -06:00
parent 29295607df
commit d2325c20bd

View File

@@ -14,18 +14,10 @@ jobs:
steps: steps:
- name: Check Out Code - name: Check Out Code
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Set up Gitea credentials
run: |
git config --global credential.helper store
echo "https://$GITEA_USER:$GITEA_TOKEN@gitea.pockle.world" >> ~/.git-credentials
env:
GITEA_USER: ${{ secrets.USER_GITEA }}
GITEA_TOKEN: ${{ secrets.TOKEN_GITEA }}
- name: Cache SDL3 (Linux) - name: Cache SDL3 (Linux)
uses: actions/cache@v3 uses: actions/cache@v3
with: with:
@@ -86,64 +78,41 @@ jobs:
path: _pack path: _pack
build-windows: build-windows:
runs-on: ubuntu-latest runs-on: win-native
container: strategy:
image: gitea.pockle.world/john/prosperon/linux:latest matrix:
msystem: [CLANG64]
steps: steps:
- name: Check Out Code - name: Check Out Code
uses: actions/checkout@v3 uses: actions/checkout@v4
- name: Setup MSYS2
uses: msys2/setup-msys2@v2
with: with:
fetch-depth: 0 msystem: ${{ matrix.msystem }}
update: true
install: |
git
zip
gzip
tar
base-devel
pacboy: |
meson
cmake
sdl3
toolchain
- name: Set up Gitea credentials - name: Build Prosperon
shell: msys2 {0}
run: | run: |
git config --global credential.helper store meson setup build -Dbuildtype=release -Db_lto=true -Db_ndebug=true -Dtracy:only_localhost=true -Dtracy:no_broadcast=true
echo "https://$GITEA_USER:$GITEA_TOKEN@gitea.pockle.world" >> ~/.git-credentials
env:
GITEA_USER: ${{ secrets.USER_GITEA }}
GITEA_TOKEN: ${{ secrets.TOKEN_GITEA }}
- name: Cache SDL3 (Windows cross)
uses: actions/cache@v3
with:
path: |
sdl3-win
sdl3-build-win
key: sdl3-win-${{ hashFiles('sdl3-win/CMakeLists.txt') }}-v2
- name: Build SDL3 (Windows cross)
run: |
if [ ! -d "sdl3-win/.git" ]; then
echo "Cloning SDL3 for Windows cross..."
git clone --depth 1 --branch main https://github.com/libsdl-org/SDL.git sdl3-win
else
echo "SDL3-win source already present (possibly from cache)."
fi
mkdir -p sdl3-build-win
cd sdl3-build-win
cmake ../sdl3-win -GNinja \
-DCMAKE_SYSTEM_NAME=Windows \
-DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc \
-DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-g++ \
-DCMAKE_RC_COMPILER=x86_64-w64-mingw32-windres \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX="${PWD}/installed_sdl3_win" \
-DSDL_SHARED=ON \
-DSDL_STATIC=OFF
ninja
ninja install
- name: Configure PKG_CONFIG_PATH (Windows cross)
run: |
echo "PKG_CONFIG_PATH=${GITHUB_WORKSPACE}/sdl3-build-win/installed_sdl3_win/lib/pkgconfig:$PKG_CONFIG_PATH" >> $GITHUB_ENV
- name: Build Prosperon (Windows cross)
run: |
meson setup build -Dbuildtype=release -Db_lto=true -Db_ndebug=true --cross-file mingw32.cross
meson compile -C build meson compile -C build
- name: Test Prosperon - name: Test Prosperon
shell: msys2 {0}
continue-on-error: true
env: env:
TRACY_NO_INVARIANT_CHECK: 1 TRACY_NO_INVARIANT_CHECK: 1
run: | run: |
@@ -158,12 +127,13 @@ jobs:
- name: Create package folder - name: Create package folder
if: startsWith(github.ref, 'refs/tags/v') if: startsWith(github.ref, 'refs/tags/v')
shell: msys2 {0}
run: | run: |
mkdir _pack mkdir _pack
cp build/prosperon.exe _pack/ cp build/prosperon.exe _pack/
cp sdl3-build-win/installed_sdl3_win/bin/SDL3.dll _pack/ pacboy sdl3 | grep "SDL3.dll$" | awk '{print $2}' | xargs -I {} cp {} _pack/
- name: Upload Artifact (Windows cross) - name: Upload Artifact (Windows)
if: startsWith(github.ref, 'refs/tags/v') if: startsWith(github.ref, 'refs/tags/v')
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
@@ -226,6 +196,7 @@ jobs:
if: ${{ false }} if: ${{ false }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
# [Deploy-itch steps remain unchanged]
- name: Check Out Code - name: Check Out Code
uses: actions/checkout@v3 uses: actions/checkout@v3
with: with:
@@ -256,6 +227,7 @@ jobs:
needs: [package-dist] needs: [package-dist]
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
# [Deploy-gitea steps remain unchanged]
- name: Check Out Code - name: Check Out Code
uses: actions/checkout@v3 uses: actions/checkout@v3
with: with: