Fix Windows CI #49
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
branches-ignore: | |
- staging.tmp | |
- trying.tmp | |
- staging-squash-merge.tmp | |
pull_request: | |
jobs: | |
build-cmake: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
include: | |
- os: ubuntu-latest | |
cmake-args: -G "Unix Makefiles" | |
build-args: --parallel | |
package-file: fng-*-linux_x86_64.tar.xz | |
- os: windows-latest | |
cmake-args: -G "Ninja" | |
package-file: fng-*-win64.zip | |
defaults: | |
run: | |
shell: ${{ matrix.os == 'windows-latest' && 'msys2 {0}' || 'bash {0}' }} | |
steps: | |
- name: Prepare Windows (msys2) | |
uses: msys2/setup-msys2@v2 | |
if: contains(matrix.os, 'windows') | |
with: | |
msystem: MINGW64 | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Prepare Linux | |
if: contains(matrix.os, 'ubuntu') | |
run: | | |
sudo apt-get update -y | |
sudo apt-get install pkg-config cmake -y | |
- name: Prepare msys dependencies | |
if: contains(matrix.os, 'windows') | |
run: | | |
pacman --noconfirm -S git mingw-w64-x86_64-toolchain cmake ninja mingw-w64-x86_64-gcc | |
- name: Build in release mode | |
run: | | |
mkdir release | |
cd release | |
${{ matrix.cmake-path }}cmake ${{ matrix.cmake-args }} -DCMAKE_BUILD_TYPE=Release -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE=. .. | |
${{ matrix.cmake-path }}cmake --build . --config Release ${{ matrix.build-args }} --target fng2_srv | |
- name: Package | |
run: | | |
cd release | |
${{ matrix.cmake-path }}cmake --build . --config Release ${{ matrix.build-args }} --target package_default | |
mkdir artifacts | |
mv ${{ matrix.package-file }} artifacts | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: fng-${{ matrix.os }} | |
path: release/artifacts |