Set IMGUI_VERSION_TAG to v1.92.8-docking for C.I. #102
This file contains hidden or 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: | |
| LIBRARIES_BRANCH: libraries-OS-COMPILER | |
| NCINE_SOURCE_BRANCH: BRANCH_NAME | |
| 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 | |
| IMGUI_VERSION_TAG: 2af6dd9694288e6befe1edb7ce25510911693c22 | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - main | |
| workflow_dispatch: | |
| jobs: | |
| Build: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| BuildType: [Debug, Release, BinDist] | |
| runs-on: 'windows-2022' | |
| steps: | |
| - name: 'Checkout Code' | |
| uses: actions/checkout@v6 | |
| - name: 'Download nCine-libraries and project data' | |
| run: | | |
| $env:GIT_REDIRECT_STDERR = '2>&1' | |
| cd .. | |
| git clone https://github.com/nCine/nCine-libraries-artifacts.git | |
| cd nCine-libraries-artifacts | |
| $env:LIBRARIES_BRANCH = $env:LIBRARIES_BRANCH -creplace "OS","windows" -creplace "COMPILER","vs2022" | |
| git checkout $env:LIBRARIES_BRANCH | |
| $libraries_file = Get-ChildItem -Path $(pwd) -Name -File | Select-Object -First 1 | |
| 7z x $libraries_file | |
| Move-Item -Path nCine-external -Destination .. | |
| cd .. | |
| Remove-Item nCine-libraries-artifacts -Recurse -Force | |
| git clone https://github.com/$env:GITHUB_REPOSITORY-data.git | |
| - name: 'Download nCine source and data' | |
| run: | | |
| $branch_name = git describe --tags --exact-match; if (-not $?) { $branch_name = git symbolic-ref -q --short HEAD }; if (-not $?) { $branch_name = git rev-parse --short HEAD } | |
| $env:NCINE_SOURCE_BRANCH = $env:NCINE_SOURCE_BRANCH -creplace "BRANCH_NAME","$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 as a static library' | |
| run: | | |
| cd ../nCine | |
| if ("${{ matrix.BuildType }}" -eq "BinDist") | |
| { $nCineBuildType = "Release" } | |
| else | |
| { $nCineBuildType = "${{ matrix.BuildType }}" } | |
| cmake -G "Visual Studio 17 2022" -A x64 -B ../nCine-build-$nCineBuildType -D CMAKE_BUILD_TYPE=$nCineBuildType -D NCINE_DYNAMIC_LIBRARY=OFF -D IMGUI_VERSION_TAG=$env:IMGUI_VERSION_TAG -D NCINE_PREFERRED_BACKEND=SDL2 -D NCINE_WITH_SCENEGRAPH=OFF -D NCINE_WITH_THREADS=OFF -D NCINE_WITH_WEBP=OFF -D NCINE_WITH_AUDIO=OFF -D NCINE_WITH_SCRIPTING_API=OFF -D NCINE_BUILD_TESTS=OFF | |
| cd .. | |
| cmake --build nCine-build-$nCineBuildType --config $nCineBuildType -j $env:NUMBER_OF_PROCESSORS | |
| - name: 'CMake Configuration' | |
| run: | | |
| $project_name = Split-Path -Path "$env:GITHUB_REPOSITORY" -leaf | |
| if ("${{ matrix.BuildType }}" -eq "BinDist") | |
| { cmake -G "Visual Studio 17 2022" -A x64 -B ../${project_name}-build-${{ matrix.BuildType }} -D NCPROJECT_OPTIONS_PRESETS=${{ matrix.BuildType }} -D nCine_DIR=$(pwd)/../nCine-build-Release } | |
| else | |
| { cmake -G "Visual Studio 17 2022" -A x64 -B ../${project_name}-build-${{ matrix.BuildType }} -D nCine_DIR=$(pwd)/../nCine-build-${{ matrix.BuildType }} } | |
| - name: 'CMake Build' | |
| run: | | |
| $project_name = Split-Path -Path "$env:GITHUB_REPOSITORY" -leaf | |
| if ("${{ matrix.BuildType }}" -eq "BinDist") | |
| { cmake --build ../${project_name}-build-${{ matrix.BuildType }} --config Release -j $env:NUMBER_OF_PROCESSORS } | |
| else | |
| { cmake --build ../${project_name}-build-${{ matrix.BuildType }} --config ${{ matrix.BuildType }} -j $env:NUMBER_OF_PROCESSORS } | |
| - name: 'Package' | |
| if: matrix.BuildType == 'BinDist' | |
| run: | | |
| $project_name = Split-Path -Path "$env:GITHUB_REPOSITORY" -leaf | |
| cmake --build ../${project_name}-build-${{ matrix.BuildType }} --config Release --target package | |
| - name: 'Prepare GitHub Actions Artifact' | |
| if: matrix.BuildType == 'BinDist' | |
| run: | | |
| $project_name = Split-Path -Path "$env:GITHUB_REPOSITORY" -leaf | |
| cd ../${project_name}-build-${{ matrix.BuildType }}/ | |
| Set-Content -Path package_file_name.cmake -Value 'include(CPackConfig.cmake)','execute_process(COMMAND ${CMAKE_COMMAND} -E echo_append "${CPACK_PACKAGE_FILE_NAME}")' | |
| $package_file_name = cmake -P package_file_name.cmake | |
| $package_ext_exe = "exe" | |
| $package_ext_zip = "zip" | |
| $package_exe = "$package_file_name.$package_ext_exe" | |
| $package_zip = "$package_file_name.$package_ext_zip" | |
| # Generate a JSON manifest file | |
| $manifest = "manifest.json" | |
| if ("${{ matrix.BuildType }}" -eq "LuaDist") { | |
| $manifest = "manifestLua.json" | |
| } | |
| $exeInfo = Get-Item $package_exe | |
| $zipInfo = Get-Item $package_zip | |
| $exeHash = (Get-FileHash -Algorithm SHA256 -Path $package_exe).Hash.ToLower() | |
| $zipHash = (Get-FileHash -Algorithm SHA256 -Path $package_zip).Hash.ToLower() | |
| $manifestObj = [ordered]@{ | |
| git_revision = $env:GITHUB_SHA | |
| artifacts = [ordered]@{ | |
| installer = [ordered]@{ | |
| filename = $package_exe | |
| size = $exeInfo.Length | |
| timestamp = $exeInfo.LastWriteTimeUtc.ToString("yyyy-MM-ddTHH:mm:ssZ") | |
| sha256 = $exeHash | |
| } | |
| portable = [ordered]@{ | |
| filename = $package_zip | |
| size = $zipInfo.Length | |
| timestamp = $zipInfo.LastWriteTimeUtc.ToString("yyyy-MM-ddTHH:mm:ssZ") | |
| sha256 = $zipHash | |
| } | |
| } | |
| } | |
| $manifestObj | | |
| ConvertTo-Json -Depth 4 | | |
| Set-Content -Encoding UTF8 $manifest | |
| $artifactsDir = Join-Path $env:GITHUB_WORKSPACE (${project_name} + '-job-artifacts') | |
| New-Item -ItemType Directory -Force $artifactsDir | Out-Null | |
| Copy-Item $package_exe $artifactsDir -Force | |
| Copy-Item $package_zip $artifactsDir -Force | |
| Copy-Item $manifest $artifactsDir -Force | |
| Write-Host "Contents of the ${project_name}-job-artifacts directory:" | |
| Get-ChildItem $artifactsDir | |
| Write-Host "Contents of the manifest file:" | |
| Get-Content $manifest -Raw | |
| - name: 'Upload GitHub Actions Artifact' | |
| if: matrix.BuildType == 'BinDist' | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: ${{ github.event.repository.name }}-job-artifacts-${{ matrix.BuildType }} | |
| path: ${{ github.event.repository.name }}-job-artifacts/* | |
| Artifacts: | |
| needs: Build | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| BuildType: [BinDist] | |
| runs-on: 'windows-2022' | |
| concurrency: | |
| group: artifacts-windows-vs2022 | |
| cancel-in-progress: false | |
| steps: | |
| - name: 'Checkout Code' | |
| uses: actions/checkout@v6 | |
| - name: 'Unshallow Git Repository for Versioning' | |
| run: | | |
| $env:GIT_REDIRECT_STDERR = '2>&1' | |
| git fetch --unshallow; if (-not $?) { return } | |
| - name: 'Download GitHub Actions Artifact' | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: ${{ github.event.repository.name }}-job-artifacts-${{ matrix.BuildType }} | |
| path: ${{ github.event.repository.name }}-job-artifacts | |
| - name: 'Push Artifacts' | |
| 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' | |
| $project_name = Split-Path -Path "$env:GITHUB_REPOSITORY" -leaf | |
| $branch_name = git describe --tags --exact-match; if (-not $?) { $branch_name = git symbolic-ref -q --short HEAD }; if (-not $?) { $branch_name = git rev-parse --short HEAD } | |
| $env:DEPLOY_MESSAGE = $env:DEPLOY_MESSAGE -creplace "PROJECT_NAME",$project_name | |
| $env:DEPLOY_MESSAGE = $env:DEPLOY_MESSAGE -creplace "BRANCH_NAME",$branch_name | |
| $env:DEPLOY_BRANCH = $env:DEPLOY_BRANCH -creplace "PROJECT_NAME",$project_name | |
| $env:DEPLOY_BRANCH = $env:DEPLOY_BRANCH -creplace "BRANCH_NAME",$branch_name | |
| $env:DEPLOY_BRANCH = $env:DEPLOY_BRANCH -creplace "OS","windows" -creplace "COMPILER","vs2022" | |
| cd ${project_name}-job-artifacts | |
| $manifest = Get-ChildItem -Filter 'manifest*.json' -Name | Select-Object -First 1 | |
| $json = Get-Content $manifest -Raw | ConvertFrom-Json | |
| $package_exe = $json.artifacts.installer.filename | |
| $package_zip = $json.artifacts.portable.filename | |
| $package_name_exe = $package_exe -replace '-.*$', '' | |
| $package_name_zip = $package_zip -replace '-.*$', '' | |
| $package_ext_exe = [IO.Path]::GetExtension($package_exe).TrimStart('.') | |
| $package_ext_zip = [IO.Path]::GetExtension($package_zip).TrimStart('.') | |
| cd .. | |
| git clone https://$env:PUBLIC_REPO_TOKEN@github.com/$env:GITHUB_REPOSITORY-artifacts.git 2>&1>$null | |
| cd ${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 ..\${project_name}-job-artifacts\$manifest -Destination . -Force | |
| Move-Item -Path ..\${project_name}-job-artifacts\$package_exe -Destination . | |
| Move-Item -Path ..\${project_name}-job-artifacts\$package_zip -Destination . | |
| git add $manifest "$package_exe" "$package_zip" | |
| 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 } |