Skip to content

Revert "[core] remove gui_console_err_printf" #330

Revert "[core] remove gui_console_err_printf"

Revert "[core] remove gui_console_err_printf" #330

name: Build Windows
on:
push:
branches: [ master, feature/github-actions, test/usbwin ]
pull_request:
branches: [ master, feature/github-actions ]
jobs:
build:
name: "Build: Windows ${{ matrix.arch }}-${{ matrix.config }}-${{ matrix.qtver }}"
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
arch: [x64, x86]
qtver: [Qt5, Qt6]
config: [Release]
exclude:
- arch: x86
qtver: Qt6
include:
- arch: x64
arch_name: 64-bit
arch_suffix: "64"
- arch: x86
arch_name: 32-bit
arch_suffix: "32"
steps:
- name: Remove Perl Strawberry installation
# Removes conflicting headers from include paths
run: |
Remove-Item -Recurse -Force C:/Strawberry
- name: Checkout Git Repo
uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: Install latest CMake
uses: lukka/get-cmake@a70f1cfa1857a3eecfe0d34962269e1b1e8be56c # latest as of 2024-08-08
- name: Restore artifacts, or setup vcpkg (do not install any package)
uses: lukka/run-vcpkg@d87e7fac99f22776a4973d7e413921ea254c1fc9 # latest as of 2024-08-08
with:
vcpkgJsonGlob: '**/gui/qt/vcpkg.json'
- name: Build CEmu ${{ matrix.qtver }} ${{ matrix.config }} on Windows ${{ matrix.arch_name }}
uses: lukka/run-cmake@4b1adc1944be8367be9f4e08303ce49918db8e3c # latest as of 2024-08-08
with:
cmakeListsTxtPath: '${{ github.workspace }}/gui/qt/CMakeLists.txt'
configurePreset: 'Win-${{ matrix.arch }}-${{ matrix.qtver }}'
configurePresetAdditionalArgs: "['-DDEPS_RELEASE_ONLY=ON', '-DSHORT_VERSION=v3.0']"
buildPreset: 'Win-${{ matrix.arch }}-${{ matrix.qtver }}-${{ matrix.config }}'
env:
VCPKG_DEFAULT_TRIPLET: ${{ matrix.arch }}-windows
VCPKG_DEFAULT_HOST_TRIPLET: x64-windows-static-release
VCPKG_FORCE_SYSTEM_BINARIES: 1
- name: Upload ${{ matrix.arch_name }} ${{ matrix.config }} ${{ matrix.qtver }} EXE
uses: actions/upload-artifact@v3
with:
name: CEmu_win${{ matrix.arch_suffix }}_${{ matrix.qtver }}_master
path: ${{ github.workspace }}/gui/qt/CEmu.build/Win-${{ matrix.arch }}-${{ matrix.qtver }}/${{ matrix.config }}/CEmu.exe
- name: Prepare binary for release upload
if: ${{ matrix.config == 'Release' }}
run: |
$ReleaseName = "CEmu-nightly_win${{ matrix.arch_suffix }}-msvc_${{ matrix.qtver }}.exe".Replace("Qt", "qt")
Rename-Item -Path "${{ github.workspace }}/gui/qt/CEmu.build/Win-${{ matrix.arch }}-${{ matrix.qtver }}/${{ matrix.config }}/CEmu.exe" -NewName $ReleaseName
echo "RELEASE_NAME=$ReleaseName" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Update nightly release
if: ${{ matrix.config == 'Release' && github.ref == 'refs/heads/master' && github.event_name != 'pull_request' }}
uses: softprops/action-gh-release@d4e8205d7e959a9107da6396278b2f1f07af0f9b # latest as of 2023-01-13
with:
tag_name: nightly
prerelease: true
token: ${{secrets.GITHUB_TOKEN}}
files: |
./gui/qt/CEmu.build/Win-${{ matrix.arch }}-${{ matrix.qtver }}/${{ matrix.config }}/${{ env.RELEASE_NAME }}