Update older macOS GitHub Actions runner to 13 #175
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: 'MinGW' | |
env: | |
LIBRARIES_BRANCH: libraries-OS-COMPILER | |
NCINE_SOURCE_BRANCH: master | |
DEPLOY_MESSAGE: | |
"Push artifact from GitHub Actions build ${{ github.run_number }} with id ${{ github.run_id }} | |
- PROJECT_NAME artifact from branch 'BRANCH_NAME' with commit id ${{ github.sha }}" | |
DEPLOY_BRANCH: PROJECT_NAME-BRANCH_NAME-OS-COMPILER | |
on: [push, workflow_dispatch] | |
jobs: | |
MinGW: | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- BuildType: Debug | |
CC: gcc | |
CXX: g++ | |
- BuildType: Release | |
CC: gcc | |
CXX: g++ | |
- BuildType: BinDist | |
CC: gcc | |
CXX: g++ | |
- BuildType: Debug | |
CC: clang | |
CXX: clang++ | |
- BuildType: Release | |
CC: clang | |
CXX: clang++ | |
- BuildType: BinDist | |
CC: clang | |
CXX: clang++ | |
runs-on: 'windows-2019' | |
steps: | |
- name: 'Checkout Code' | |
uses: actions/checkout@v4 | |
- name: 'Update MSYS2' | |
run: | | |
$env:MSYSTEM = "MINGW64" | |
C:\msys64\usr\bin\bash -lc 'pacman --noconfirm -Syyuu' | |
C:\msys64\usr\bin\bash -lc 'pacman --noconfirm -Syyuu' | |
- name: 'Install Build Dependencies' | |
run: | | |
$env:MSYSTEM = "MINGW64" | |
C:\msys64\usr\bin\bash -lc 'pacman --needed --noconfirm -S mingw-w64-x86_64-glew mingw-w64-x86_64-glfw mingw-w64-x86_64-SDL2 mingw-w64-x86_64-openal mingw-w64-x86_64-libvorbis mingw-w64-x86_64-libwebp mingw-w64-x86_64-lua mingw-w64-x86_64-box2d mingw-w64-x86_64-cmake' | |
if ("${{ matrix.CC }}" -eq "gcc") { C:\msys64\usr\bin\bash -lc 'pacman --needed --noconfirm -S mingw-w64-x86_64-gcc' } | |
else { C:\msys64\usr\bin\bash -lc 'pacman --needed --noconfirm -S mingw-w64-x86_64-clang' } | |
C:\msys64\usr\bin\bash -lc 'pacman --noconfirm -Scc' | |
- name: 'Unshallow Git Repository for Versioning' | |
if: matrix.BuildType == 'BinDist' | |
run: | | |
$env:GIT_REDIRECT_STDERR = '2>&1' | |
git fetch --unshallow; if (-not $?) { return } | |
- name: 'Download nCine-libraries and project data' | |
run: | | |
$env:GIT_REDIRECT_STDERR = '2>&1' | |
$env:branch_name = git describe --tags --exact-match; if (-not $?) { $env:branch_name = git symbolic-ref -q --short HEAD }; if (-not $?) { $env:branch_name = git rev-parse --short HEAD } | |
$env:CC = "${{ matrix.CC }}" | |
cd .. | |
git clone https://github.com/nCine/nCine-libraries-artifacts.git | |
cd nCine-libraries-artifacts | |
cd .. | |
Remove-Item nCine-libraries-artifacts -Recurse -Force | |
git clone https://github.com/$env:GITHUB_REPOSITORY-data.git | |
# Temporary hack to restore the `data` subdirectory | |
cd ncJump-data | |
New-Item -ItemType directory -Path data | |
Move-Item -Path .\*.png -Destination data | |
Move-Item -Path .\*.json -Destination data | |
Move-Item -Path .\*.ini -Destination data | |
Move-Item -Path img -Destination data | |
- name: 'Download nCine source and data' | |
run: | | |
$env:branch_name = git describe --tags --exact-match; if (-not $?) { $env:branch_name = git symbolic-ref -q --short HEAD }; if (-not $?) { $env:branch_name = git rev-parse --short HEAD } | |
$env:NCINE_SOURCE_BRANCH = $env:NCINE_SOURCE_BRANCH -creplace "BRANCH_NAME","$env:branch_name" | |
cd .. | |
git clone https://github.com/nCine/nCine-data.git | |
git clone https://github.com/nCine/nCine.git --branch $env:NCINE_SOURCE_BRANCH | |
- name: 'CMake Configuration and Make of nCine with docking ImGui' | |
env: | |
CHERE_INVOKING: on | |
run: | | |
$env:CC= "${{ matrix.CC }}" | |
$env:CXX = "${{ matrix.CXX }}" | |
$env:MSYSTEM = "MINGW64" | |
cd ../nCine | |
if ("${{ matrix.BuildType }}" -eq "BinDist") | |
{ | |
C:\msys64\usr\bin\bash.exe -lc "cmake -G 'MSYS Makefiles' -B ../nCine-build-Release -D CMAKE_BUILD_TYPE=Release -D IMGUI_VERSION_TAG=docking -D NCINE_BUILD_TESTS=OFF" | |
C:\msys64\usr\bin\bash.exe -lc 'make -j2 -C ../nCine-build-Release' | |
} | |
else | |
{ | |
C:\msys64\usr\bin\bash.exe -lc "cmake -G 'MSYS Makefiles' -B ../nCine-build-${{ matrix.BuildType }} -D CMAKE_BUILD_TYPE=${{ matrix.BuildType }} -D IMGUI_VERSION_TAG=docking -D NCINE_BUILD_TESTS=OFF" | |
C:\msys64\usr\bin\bash.exe -lc 'make -j2 -C ../nCine-build-${{ matrix.BuildType }}' | |
} | |
- name: 'CMake Configuration' | |
env: | |
CHERE_INVOKING: on | |
run: | | |
$env:CC= "${{ matrix.CC }}" | |
$env:CXX = "${{ matrix.CXX }}" | |
$env:PROJECT_NAME = Split-Path -Path "$env:GITHUB_REPOSITORY" -leaf | |
$env:MSYSTEM = "MINGW64" | |
if ("${{ matrix.BuildType }}" -eq "BinDist") | |
{ C:\msys64\usr\bin\bash.exe -lc "cmake -G 'MSYS Makefiles' -B ../$env:PROJECT_NAME-build-${{ matrix.BuildType }} -D NCPROJECT_OPTIONS_PRESETS=${{ matrix.BuildType }} -D nCine_DIR=$(cygpath -m $PWD/../nCine-build-Release)" } | |
else | |
{ C:\msys64\usr\bin\bash.exe -lc "cmake -G 'MSYS Makefiles' -B ../$env:PROJECT_NAME-build-${{ matrix.BuildType }} -D CMAKE_BUILD_TYPE=${{ matrix.BuildType }} -D nCine_DIR=$(cygpath -m $PWD/../nCine-build-${{ matrix.BuildType }})" } | |
- name: 'Make' | |
env: | |
CHERE_INVOKING: on | |
run: | | |
$env:PROJECT_NAME = Split-Path -Path "$env:GITHUB_REPOSITORY" -leaf | |
$env:MSYSTEM = "MINGW64" | |
C:\msys64\usr\bin\bash.exe -lc 'make -j2 -C ../$PROJECT_NAME-build-${{ matrix.BuildType }}' | |
- name: 'Package' | |
if: matrix.BuildType == 'BinDist' | |
env: | |
CHERE_INVOKING: on | |
run: | | |
$env:PROJECT_NAME = Split-Path -Path "$env:GITHUB_REPOSITORY" -leaf | |
$env:MSYSTEM = "MINGW64" | |
C:\msys64\usr\bin\bash.exe -lc 'make package -C ../$PROJECT_NAME-build-${{ matrix.BuildType }}' | |
- name: 'Push Artifacts' | |
if: matrix.BuildType == 'BinDist' | |
env: | |
PUBLIC_REPO_TOKEN: ${{ secrets.PUBLIC_REPO_TOKEN }} | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "Azure Pipelines" | |
$env:GIT_REDIRECT_STDERR = '2>&1' | |
$env:CC = "${{ matrix.CC }}" | |
$env:project_name = Split-Path -Path "$env:GITHUB_REPOSITORY" -leaf | |
$env:branch_name = git describe --tags --exact-match; if (-not $?) { $env:branch_name = git symbolic-ref -q --short HEAD }; if (-not $?) { $env:branch_name = git rev-parse --short HEAD } | |
$env:DEPLOY_MESSAGE = $env:DEPLOY_MESSAGE -creplace "PROJECT_NAME",$env:project_name | |
$env:DEPLOY_MESSAGE = $env:DEPLOY_MESSAGE -creplace "BRANCH_NAME",$env:branch_name | |
$env:DEPLOY_BRANCH = $env:DEPLOY_BRANCH -creplace "PROJECT_NAME",$env:project_name | |
$env:DEPLOY_BRANCH = $env:DEPLOY_BRANCH -creplace "BRANCH_NAME",$env:branch_name | |
$env:DEPLOY_BRANCH = $env:DEPLOY_BRANCH -creplace "OS","mingw64" -creplace "COMPILER",$env:CC | |
cd .. | |
git clone https://$env:[email protected]/$env:GITHUB_REPOSITORY-artifacts.git 2>&1>$null | |
cd $env:project_name-artifacts | |
git checkout $env:DEPLOY_BRANCH; if (-not $?) { git checkout --orphan $env:DEPLOY_BRANCH } | |
git reset | |
git clean -f | |
git rm * | |
Move-Item -Path ..\$env:project_name-build-${{ matrix.BuildType }}\*.tar.gz -Destination . | |
git add *.tar.gz | |
git commit --amend -m "$env:DEPLOY_MESSAGE"; if (-not $?) { git commit -m "$env:DEPLOY_MESSAGE" } | |
git push --force; if (-not $?) { git push --set-upstream origin $env:DEPLOY_BRANCH } |