mirror of
https://github.com/arabianq/build_msp.git
synced 2026-04-28 14:31:24 +00:00
81 lines
2.9 KiB
YAML
81 lines
2.9 KiB
YAML
name: Push Build
|
|
|
|
on:
|
|
push:
|
|
branches: [main, master]
|
|
workflow_dispatch:
|
|
inputs:
|
|
commit_id:
|
|
description: "Commit ID to build from"
|
|
required: true
|
|
default: ""
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
with:
|
|
ref: ${{ github.event.inputs.commit_id || github.sha }}
|
|
submodules: recursive
|
|
|
|
- name: Install dependencies (Linux)
|
|
if: startsWith(runner.os, 'Linux')
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y build-essential cmake
|
|
|
|
- name: Install latest CMake (Linux)
|
|
if: startsWith(runner.os, 'Linux')
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y wget
|
|
wget https://github.com/Kitware/CMake/releases/download/v4.0.0/cmake-4.0.0-linux-x86_64.sh
|
|
sudo sh cmake-4.0.0-linux-x86_64.sh --skip-license --prefix=/usr/local
|
|
cmake --version
|
|
|
|
- name: Install dependencies (macOS)
|
|
if: startsWith(runner.os, 'macOS')
|
|
run: |
|
|
brew update
|
|
brew install cmake
|
|
|
|
- name: Install MSYS2 and MinGW-w64 (Windows)
|
|
if: startsWith(runner.os, 'Windows')
|
|
uses: msys2/setup-msys2@v2
|
|
with:
|
|
msystem: MINGW64
|
|
update: true
|
|
install: >-
|
|
mingw-w64-x86_64-gcc
|
|
mingw-w64-x86_64-cmake
|
|
mingw-w64-x86_64-make
|
|
git
|
|
|
|
- name: Configure and Build (Windows)
|
|
if: startsWith(runner.os, 'Windows')
|
|
shell: msys2 {0}
|
|
run: |
|
|
cmake . -G "MinGW Makefiles" \
|
|
-DCMAKE_C_FLAGS="-finput-charset=UTF-8 -fexec-charset=UTF-8" \
|
|
-DCMAKE_CXX_FLAGS="-finput-charset=UTF-8 -fexec-charset=UTF-8" \
|
|
-DCMAKE_EXE_LINKER_FLAGS="-static -static-libgcc -static-libstdc++"
|
|
cmake --build .
|
|
|
|
- name: Configure and Build (Linux/macOS)
|
|
if: startsWith(runner.os, 'Linux') || startsWith(runner.os, 'macOS')
|
|
run: |
|
|
cmake .
|
|
make
|
|
|
|
- name: Upload Artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: build_msp-${{ matrix.os }}-${{ github.event.inputs.commit_id || github.sha }}${{ startsWith(matrix.os, 'Windows') && '.exe' || '' }}
|
|
path: build_msp${{ startsWith(matrix.os, 'Windows') && '.exe' || '' }}
|