Skip to content

Create windows-cross.yml #21

Create windows-cross.yml

Create windows-cross.yml #21

# FreeMajor CMake Multi-Platform - Linux + macOS
name: FreeMajor CMake Multi-Platform
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
release:
types: [ published, prereleased ]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
name: "Linux"
build_type: Release
- os: macos-latest
name: "macOS"
build_type: Release
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set reusable strings
id: strings
shell: bash
run: |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
# === LINUX ===
- name: Install Linux dependencies
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y \
cmake \
build-essential \
libasound2-dev \
libjack-jackd2-dev \
libfltk1.3-dev \
gettext \
git
# === macOS ===
- name: Install macOS dependencies
if: matrix.os == 'macos-latest'
run: |
brew install cmake fltk gettext
# Configure Linux/macOS
- name: Configure CMake (Linux/macOS)
if: matrix.os != 'windows-latest'
run: |
cmake -B ${{ steps.strings.outputs.build-output-dir }} \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-S ${{ github.workspace }}
# Build TOUS les OS
- name: Build
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }}
# Debug output
- name: List build results
if: always()
run: |
find ${{ steps.strings.outputs.build-output-dir }} -name "*FreeMajor*" -type f 2>/dev/null || true
shell: bash
# Archive releases only
- name: Package binaries
if: startsWith(github.ref, 'refs/tags/') &&
(contains(github.ref_name, 'nightly') || contains(github.ref_name, 'pre') || startsWith(github.ref_name, 'v'))
shell: bash
run: |
cd ${{ steps.strings.outputs.build-output-dir }}
find . -name "*FreeMajor*" -type f -executable 2>/dev/null | head -5 | xargs tar -czf FreeMajor-${{ matrix.name }}.tar.gz || true
- name: Upload binaries
if: startsWith(github.ref, 'refs/tags/') &&
(contains(github.ref_name, 'nightly') || contains(github.ref_name, 'pre') || startsWith(github.ref_name, 'v'))
uses: actions/upload-artifact@v4
with:
name: FreeMajor-${{ matrix.name }}
path: ${{ steps.strings.outputs.build-output-dir }}/*.tar.gz
retention-days: 90