Update SDL2 to 2.30.5 #103
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: 'Windows' | |
env: | |
DEPLOY_FILE_NOEXT: nCine-external-OS-COMPILER-VERSION | |
DEPLOY_MESSAGE: | |
"Push artifact from GitHub Actions build ${{ github.run_number }} with id ${{ github.run_id }} | |
- nCine-libraries artifact from branch 'BRANCH_NAME' with commit id ${{ github.sha }}" | |
DEPLOY_BRANCH: libraries-OS-COMPILER | |
on: [push, workflow_dispatch] | |
jobs: | |
Windows: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [windows-2019, windows-2022] | |
BuildType: [Debug, Release] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: 'Checkout code' | |
uses: actions/checkout@v4 | |
- name: 'CMake Configuration' | |
run: | | |
$env:generator = switch ("${{ matrix.os }}") | |
{ | |
"windows-2022" {"Visual Studio 17 2022"} | |
"windows-2019" {"Visual Studio 16 2019"} | |
} | |
cmake -G "$env:generator" -A x64 -B ../nCine-libraries-build | |
- name: 'CMake Build' | |
run: | | |
cmake --build ../nCine-libraries-build --config ${{ matrix.BuildType }} | |
- name: 'Push Artifacts' | |
if: matrix.BuildType == 'Release' | |
env: | |
PUBLIC_REPO_TOKEN: ${{ secrets.PUBLIC_REPO_TOKEN }} | |
run: | | |
git config --global user.email "actions@github.com" | |
git config --global user.name "GitHub Actions" | |
$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:DEPLOY_MESSAGE = $env:DEPLOY_MESSAGE -replace "BRANCH_NAME",$env:branch_name | |
$env:vsversion = switch ("${{ matrix.os }}") | |
{ | |
"windows-2022" {"vs2022"} | |
"windows-2019" {"vs2019"} | |
} | |
git fetch --unshallow; if (-not $?) { return } | |
git describe --tags --long 2>$null; if ($?) { $env:git_version = git describe --tags --long 2>$null | %{$_ -replace "([^-]*-g)","r`$1" -replace "-","."} } else { $env:git_version = -join("r", $(git rev-list --count HEAD), ".", $(git rev-parse --short HEAD)) } | |
cd .. | |
$env:DEPLOY_FILE = -join($env:DEPLOY_FILE_NOEXT, ".7z") | |
$env:DEPLOY_FILE = $env:DEPLOY_FILE -replace "OS","windows" -replace "COMPILER",$env:vsversion -replace "VERSION",$env:git_version | |
$env:DEPLOY_BRANCH = $env:DEPLOY_BRANCH -replace "OS","windows" -replace "COMPILER",$env:vsversion | |
7z a $env:DEPLOY_FILE nCine-external | |
git clone https://$env:PUBLIC_REPO_TOKEN@github.com/nCine/nCine-libraries-artifacts.git 2>&1>$null | |
cd nCine-libraries-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:DEPLOY_FILE -Destination . | |
git add $env:DEPLOY_FILE | |
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 } |