mirror of
https://github.com/ares-emulator/ares.git
synced 2026-10-12 02:11:04 +00:00
154 lines
5.3 KiB
YAML
154 lines
5.3 KiB
YAML
name: Build
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
codesign:
|
|
description: Enable codesigning
|
|
required: false
|
|
default: false
|
|
type: boolean
|
|
jobs:
|
|
build:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
program:
|
|
- ares
|
|
config:
|
|
- RelWithDebInfo
|
|
platform:
|
|
- name: windows-x64
|
|
os: windows-latest
|
|
compiler: clang++
|
|
shell: 'msys2 {0}'
|
|
msystem: clang64
|
|
install: mingw-w64-clang-x86_64-clang
|
|
target-cmake-preset: windows-ci-mingw-native
|
|
- name: windows-x64-gcc
|
|
os: windows-latest
|
|
compiler: g++
|
|
shell: 'msys2 {0}'
|
|
msystem: mingw64
|
|
install: mingw-w64-x86_64-toolchain
|
|
target-cmake-preset: windows-ci-mingw-native
|
|
- name: windows-clang-cl-x64
|
|
os: windows-latest
|
|
windres: rc
|
|
shell: bash
|
|
target-cmake-preset: windows-ci-cl-native
|
|
- name: windows-clang-cl-arm64
|
|
os: windows-latest
|
|
windres: rc
|
|
shell: bash
|
|
target-cmake-preset: windows-ci-cl-cross
|
|
native-cmake-preset: windows-ci-cl-native
|
|
- name: windows-msvc-x64
|
|
os: windows-latest
|
|
windres: rc
|
|
shell: bash
|
|
target-cmake-preset: windows-ci-msvc-native
|
|
- name: windows-msvc-arm64
|
|
os: windows-latest
|
|
windres: rc
|
|
shell: bash
|
|
target-cmake-preset: windows-ci-msvc-cross
|
|
native-cmake-preset: windows-ci-msvc-native
|
|
- name: macos-universal
|
|
os: macos-15
|
|
compiler: clang++
|
|
shell: sh
|
|
install: cmake ccache xcbeautify
|
|
target-cmake-preset: macos-ci-universal
|
|
- name: ubuntu
|
|
os: ubuntu-latest
|
|
compiler: g++
|
|
shell: bash
|
|
install: cmake ccache ninja-build libsdl2-dev libgtk-3-dev libao-dev libopenal-dev
|
|
target-cmake-preset: ubuntu-ci
|
|
name: ${{ matrix.program }}-${{ matrix.platform.name }}
|
|
runs-on: ${{ matrix.platform.os }}
|
|
defaults:
|
|
run:
|
|
shell: ${{ matrix.platform.shell }}
|
|
steps:
|
|
- name: Install MSYS2 Dependencies
|
|
if: matrix.platform.shell == 'msys2 {0}'
|
|
uses: msys2/setup-msys2@v2
|
|
with:
|
|
msystem: ${{ matrix.platform.msystem }}
|
|
install: make git cmake ccache ninja ${{ matrix.platform.install }}
|
|
- name: "macOS: Import Certificate"
|
|
if: runner.os == 'macOS' && inputs.codesign
|
|
uses: apple-actions/import-codesign-certs@v3
|
|
continue-on-error: ${{ !inputs.codesign }}
|
|
with:
|
|
p12-file-base64: ${{ secrets.MACOS_CERTIFICATE_DATA }}
|
|
p12-password: ${{ secrets.MACOS_CERTIFICATE_PASSPHRASE }}
|
|
- name: Checkout source code
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-tags: true
|
|
fetch-depth: 0
|
|
- name: Install Linux Dependencies
|
|
if: runner.os == 'Linux'
|
|
run: |
|
|
sudo apt-get update -y -qq
|
|
sudo apt-get install ${{ matrix.platform.install }}
|
|
- name: Install macOS Dependencies
|
|
if: runner.os == 'macOS'
|
|
run: |
|
|
brew install ${{ matrix.platform.install }}
|
|
- name: "Build: Linux"
|
|
if: runner.os == 'Linux'
|
|
run: .github/scripts/build_ubuntu.sh
|
|
env:
|
|
TARGET_PRESET: ${{ matrix.platform.target-cmake-preset }}
|
|
- name: "Build: Windows"
|
|
if: runner.os != 'macOS' && runner.os != 'Linux'
|
|
run: .github/scripts/build_windows.sh
|
|
env:
|
|
CROSS_COMPILE: ${{ matrix.platform.native-cmake-preset != '' }}
|
|
NATIVE_PRESET: ${{ matrix.platform.native-cmake-preset }}
|
|
TARGET_PRESET: ${{ matrix.platform.target-cmake-preset }}
|
|
- name: "Windows: sign"
|
|
if: runner.os == 'Windows' && inputs.codesign
|
|
uses: DanaBear/code-sign-action@98c79121b376beab8d6a9484f445089db4461bca
|
|
with:
|
|
certificate: '${{ secrets.WIN_CERTIFICATE }}'
|
|
password: '${{ secrets.WIN_PASSWORD }}'
|
|
certificatesha1: '${{ secrets.WIN_CERTHASH }}'
|
|
certificatename: '${{ secrets.WIN_CERTNAME }}'
|
|
folder: 'build/desktop-ui/rundir/'
|
|
timestampUrl: 'http://timestamp.digicert.com'
|
|
- name: "Build: macOS"
|
|
if: runner.os == 'macOS'
|
|
run: .github/scripts/build_macos.sh
|
|
env:
|
|
TARGET_PRESET: ${{ matrix.platform.target-cmake-preset }}
|
|
MACOS_CERTIFICATE_NAME: ${{ secrets.MACOS_CERTIFICATE_NAME }}
|
|
MACOS_NOTARIZATION_TEAMID: ${{ secrets.MACOS_NOTARIZATION_TEAMID }}
|
|
- name: Upload Build (Windows)
|
|
if: runner.os != 'macOS' && runner.os != 'Linux'
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: ${{ matrix.program }}-${{ matrix.platform.name }}
|
|
path: build/desktop-ui/rundir/*
|
|
- name: Upload Build (macOS)
|
|
if: runner.os == 'macOS'
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: ${{ matrix.program }}-${{ matrix.platform.name }}
|
|
path: build/desktop-ui/RelWithDebInfo/
|
|
- name: Upload Debug Symbols (Windows)
|
|
if: runner.os != 'macOS' && runner.os != 'Linux'
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: ${{ matrix.program }}-${{ matrix.platform.name }}-PDBs
|
|
path: build/PDBs/*
|
|
- name: Upload Debug Symbols (macOS)
|
|
if: runner.os == 'macOS'
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: ${{ matrix.program }}-${{ matrix.platform.name }}-dSYMs
|
|
path: build/dSYMs/*
|