mirror of
https://github.com/azahar-emu/azahar.git
synced 2026-06-06 02:33:44 -04:00
ci: Implement MXE CI/CD build job
This commit is contained in:
parent
854e198196
commit
652fc02175
3 changed files with 56 additions and 8 deletions
26
.ci/mxe.sh
Executable file
26
.ci/mxe.sh
Executable file
|
|
@ -0,0 +1,26 @@
|
||||||
|
#!/bin/bash -ex
|
||||||
|
|
||||||
|
# TODO: Why doesn't the CI environment use the PATH set in the Dockerimage?
|
||||||
|
# It works fine when using the image locally.
|
||||||
|
export PATH="/mxe/usr/bin:${PATH}"
|
||||||
|
|
||||||
|
mkdir build && cd build
|
||||||
|
|
||||||
|
if [ "$GITHUB_REF_TYPE" == "tag" ]; then
|
||||||
|
export EXTRA_CMAKE_FLAGS=(-DENABLE_QT_UPDATE_CHECKER=ON)
|
||||||
|
fi
|
||||||
|
|
||||||
|
x86_64-w64-mingw32.shared-cmake .. \
|
||||||
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
|
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
|
||||||
|
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
||||||
|
-DENABLE_QT_TRANSLATION=ON \
|
||||||
|
-DUSE_DISCORD_PRESENCE=ON \
|
||||||
|
-DUSE_SYSTEM_BOOST=ON \
|
||||||
|
-DUSE_SYSTEM_CRYPTOPP=ON \
|
||||||
|
"${EXTRA_CMAKE_FLAGS[@]}"
|
||||||
|
x86_64-w64-mingw32.shared-cmake --build . -- -j$(nproc)
|
||||||
|
x86_64-w64-mingw32.shared-strip -s bin/Release/*.exe
|
||||||
|
make bundle
|
||||||
|
|
||||||
|
ccache -s -v
|
||||||
|
|
@ -36,10 +36,10 @@ function pack_artifacts() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Create .zip/.tar.gz
|
# Create .zip/.tar.gz
|
||||||
if [ "$OS" = "windows" ]; then
|
if [ "$OS" = "windows" ] && [ "$TARGET" != "mxe" ]; then
|
||||||
ARCHIVE_FULL_NAME="$ARCHIVE_NAME.zip"
|
ARCHIVE_FULL_NAME="$ARCHIVE_NAME.zip"
|
||||||
powershell Compress-Archive "$REV_NAME" "$ARCHIVE_FULL_NAME"
|
powershell Compress-Archive "$REV_NAME" "$ARCHIVE_FULL_NAME"
|
||||||
elif [ "$OS" = "android" ] || [ "$OS" = "macos" ]; then
|
elif [ "$OS" = "android" ] || [ "$OS" = "macos" ] || [ "$TARGET" = "mxe" ]; then
|
||||||
ARCHIVE_FULL_NAME="$ARCHIVE_NAME.zip"
|
ARCHIVE_FULL_NAME="$ARCHIVE_NAME.zip"
|
||||||
zip -r "$ARCHIVE_FULL_NAME" "$REV_NAME"
|
zip -r "$ARCHIVE_FULL_NAME" "$REV_NAME"
|
||||||
else
|
else
|
||||||
|
|
|
||||||
34
.github/workflows/build.yml
vendored
34
.github/workflows/build.yml
vendored
|
|
@ -143,11 +143,21 @@ jobs:
|
||||||
path: artifacts/
|
path: artifacts/
|
||||||
|
|
||||||
windows:
|
windows:
|
||||||
runs-on: windows-latest
|
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
target: ["msvc", "msys2"]
|
include:
|
||||||
|
- target: msvc
|
||||||
|
os: windows-latest
|
||||||
|
- target: msys2
|
||||||
|
os: windows-latest
|
||||||
|
- target: mxe
|
||||||
|
os: ubuntu-latest
|
||||||
|
container:
|
||||||
|
image: opensauce04/azahar-build-environment:latest
|
||||||
|
options: -u 1001
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
container: ${{ matrix.container }}
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
shell: ${{ (matrix.target == 'msys2' && 'msys2') || 'bash' }} {0}
|
shell: ${{ (matrix.target == 'msys2' && 'msys2') || 'bash' }} {0}
|
||||||
|
|
@ -195,23 +205,35 @@ jobs:
|
||||||
with:
|
with:
|
||||||
args: install ptime wget
|
args: install ptime wget
|
||||||
- name: Install NSIS
|
- name: Install NSIS
|
||||||
if: ${{ github.ref_type == 'tag' }}
|
if: ${{ github.ref_type == 'tag' && matrix.target != 'mxe' }}
|
||||||
run: |
|
run: |
|
||||||
wget https://download.sourceforge.net/project/nsis/NSIS%203/3.11/nsis-3.11-setup.exe -O D:/a/_temp/nsis-setup.exe
|
wget https://download.sourceforge.net/project/nsis/NSIS%203/3.11/nsis-3.11-setup.exe -O D:/a/_temp/nsis-setup.exe
|
||||||
ptime D:/a/_temp/nsis-setup.exe /S
|
ptime D:/a/_temp/nsis-setup.exe /S
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
- name: Disable line ending translation
|
- name: Disable line ending translation
|
||||||
run: git config --global core.autocrlf input
|
run: git config --global core.autocrlf input
|
||||||
- name: Build
|
- name: Build (Native)
|
||||||
|
if: ${{ matrix.target != 'mxe' }}
|
||||||
run: ./.ci/windows.sh
|
run: ./.ci/windows.sh
|
||||||
- name: Generate installer
|
- name: Build (MXE)
|
||||||
if: ${{ github.ref_type == 'tag' }}
|
if: ${{ matrix.target == 'mxe' }}
|
||||||
|
run: ./.ci/mxe.sh
|
||||||
|
- name: Generate installer (Native)
|
||||||
|
if: ${{ github.ref_type == 'tag' && matrix.target != 'mxe' }}
|
||||||
run: |
|
run: |
|
||||||
cd src\installer
|
cd src\installer
|
||||||
"C:\Program Files (x86)\NSIS\makensis.exe" /DPRODUCT_VARIANT=${{ matrix.target }} /DPRODUCT_VERSION=${{ github.ref_name }} citra.nsi
|
"C:\Program Files (x86)\NSIS\makensis.exe" /DPRODUCT_VARIANT=${{ matrix.target }} /DPRODUCT_VERSION=${{ github.ref_name }} citra.nsi
|
||||||
mkdir ..\..\artifacts 2> NUL
|
mkdir ..\..\artifacts 2> NUL
|
||||||
move /y *.exe ..\..\artifacts\
|
move /y *.exe ..\..\artifacts\
|
||||||
shell: cmd
|
shell: cmd
|
||||||
|
- name: Generate installer (MXE)
|
||||||
|
if: ${{ github.ref_type == 'tag' && matrix.target == 'mxe' }}
|
||||||
|
run: |
|
||||||
|
export PATH="/mxe/usr/bin:${PATH}" # TODO: Why do we have to do this if it's in the image?
|
||||||
|
cd src/installer
|
||||||
|
x86_64-w64-mingw32.shared-makensis -DPRODUCT_VARIANT=${{ matrix.target }} -DPRODUCT_VERSION=${{ github.ref_name }} citra.nsi
|
||||||
|
mkdir -p ../../artifacts
|
||||||
|
mv ./*.exe ../../artifacts/
|
||||||
- name: Pack
|
- name: Pack
|
||||||
run: ./.ci/pack.sh
|
run: ./.ci/pack.sh
|
||||||
- name: Upload
|
- name: Upload
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue