589 lines
23 KiB
YAML
589 lines
23 KiB
YAML
name: Example App Build
|
||
on:
|
||
push:
|
||
paths:
|
||
- '*.txt'
|
||
- 'lib_source/**'
|
||
- 'example/**'
|
||
- 'scripts/**'
|
||
- '3rdparty/**'
|
||
- '.github/workflows/app_build_workflow.yml'
|
||
pull_request:
|
||
paths:
|
||
- '*.txt'
|
||
- 'example/**'
|
||
- 'lib_source/**'
|
||
- 'scripts/**'
|
||
- '3rdparty/**'
|
||
- '.github/workflows/app_build_workflow.yml'
|
||
|
||
env:
|
||
REPO_NAME: ${{ github.event.repository.name }}
|
||
APP_NAME: RibbonUI-APP
|
||
QT_VERSION: 6.6.3
|
||
QT_MODULES: qt5compat
|
||
RELEASE_OR_NIGHTLY: ${{ startsWith(github.ref, 'refs/tags/v') && 'RELEASE' || 'NIGHTLY' }}
|
||
|
||
jobs:
|
||
build-macos-shared:
|
||
name: macOS (Shared Library)
|
||
runs-on: ${{ matrix.os }}
|
||
strategy:
|
||
matrix:
|
||
os: [macos-14]
|
||
qt_ver: ${{ env.QT_VERSION }}
|
||
qt_arch: [clang_64]
|
||
env:
|
||
targetName: ${{ env.APP_NAME }}
|
||
steps:
|
||
- name: Check out repository
|
||
uses: actions/checkout@v4
|
||
with:
|
||
submodules: recursive
|
||
|
||
- name: Install Qt
|
||
uses: jurplel/install-qt-action@v3
|
||
with:
|
||
version: ${{ matrix.qt_ver }}
|
||
arch: ${{ matrix.qt_arch }}
|
||
modules: ${{ env.QT_MODULES }}
|
||
|
||
- name: Set up Ninja
|
||
uses: seanmiddleditch/gha-setup-ninja@v4
|
||
with:
|
||
version: 1.10.2
|
||
|
||
- name: build macos
|
||
run: |
|
||
cmake --version
|
||
mkdir build
|
||
cd build
|
||
cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_PREFIX_PATH=/Users/runner/work/${{ env.REPO_NAME }}/Qt/${{ matrix.qt_ver }}/macos -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Release -GNinja ..
|
||
cmake --build . --target all --config Release --parallel
|
||
|
||
- name: package
|
||
run: |
|
||
# 先删除所有dSYM文件,减少包的体积
|
||
sudo find /Users/runner/work/${{ env.REPO_NAME }}/Qt/${{ matrix.qt_ver }}/macos/qml -name "*.dSYM" | xargs rm -r
|
||
# 拷贝依赖
|
||
sudo macdeployqt /Users/runner/work/${{ env.REPO_NAME }}/${{ env.REPO_NAME }}/build/app/release/${targetName}.app -qmldir=. -verbose=1 -dmg
|
||
|
||
- uses: actions/upload-artifact@v4
|
||
with:
|
||
name: ${{ env.targetName }}_${{ matrix.os }}_${{matrix.qt_ver}}_shared
|
||
path: /Users/runner/work/${{ env.REPO_NAME }}/${{ env.REPO_NAME }}/build/app/release/${{ env.targetName }}.dmg
|
||
|
||
- name: uploadRelease
|
||
if: startsWith(github.event.ref, 'refs/tags/')
|
||
uses: svenstaro/upload-release-action@v2
|
||
with:
|
||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||
file: /Users/runner/work/${{ env.REPO_NAME }}/${{ env.REPO_NAME }}/build/app/release/${{ env.targetName }}.dmg
|
||
asset_name: ${{ env.targetName }}_${{ github.ref_name }}_${{ matrix.os }}_Qt${{ matrix.qt_ver }}_shared.dmg
|
||
tag: ${{ github.ref }}
|
||
overwrite: true
|
||
|
||
build-macos-static:
|
||
name: macOS (Static Library)
|
||
runs-on: ${{ matrix.os }}
|
||
strategy:
|
||
matrix:
|
||
os: [macos-14]
|
||
qt_ver: [env.QT_VERSION]
|
||
qt_arch: [clang_64]
|
||
env:
|
||
targetName: ${{ env.APP_NAME }}
|
||
steps:
|
||
- name: Check out repository
|
||
uses: actions/checkout@v4
|
||
with:
|
||
submodules: recursive
|
||
|
||
- name: Install Qt
|
||
uses: jurplel/install-qt-action@v3
|
||
with:
|
||
version: ${{ matrix.qt_ver }}
|
||
arch: ${{ matrix.qt_arch }}
|
||
modules: ${{ env.QT_MODULES }}
|
||
|
||
- name: Set up Ninja
|
||
uses: seanmiddleditch/gha-setup-ninja@v4
|
||
with:
|
||
version: 1.10.2
|
||
|
||
- name: build macos
|
||
run: |
|
||
cmake --version
|
||
mkdir build
|
||
cd build
|
||
cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_PREFIX_PATH=/Users/runner/work/${{ env.REPO_NAME }}/Qt/${{ matrix.qt_ver }}/macos -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Release -D${{ env.REPO_NAME }}_BUILD_STATIC_LIB=ON -GNinja ..
|
||
cmake --build . --target all --config Release --parallel
|
||
|
||
- name: package
|
||
run: |
|
||
sudo find /Users/runner/work/${{ env.REPO_NAME }}/Qt/${{ matrix.qt_ver }}/macos/qml -name "*.dSYM" | xargs rm -r
|
||
# 拷贝依赖
|
||
sudo macdeployqt /Users/runner/work/${{ env.REPO_NAME }}/${{ env.REPO_NAME }}/build/app/release/${targetName}.app -qmldir=. -verbose=1 -dmg
|
||
|
||
- uses: actions/upload-artifact@v4
|
||
with:
|
||
name: ${{ env.targetName }}_${{ matrix.os }}_${{matrix.qt_ver}}_static_${{ env.RELEASE_OR_NIGHTLY }}
|
||
path: /Users/runner/work/${{ env.REPO_NAME }}/${{ env.REPO_NAME }}/build/app/release/${{ env.targetName }}.dmg
|
||
|
||
- name: uploadRelease
|
||
if: startsWith(github.event.ref, 'refs/tags/')
|
||
uses: svenstaro/upload-release-action@v2
|
||
with:
|
||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||
file: /Users/runner/work/${{ env.REPO_NAME }}/${{ env.REPO_NAME }}/build/app/release/${{ env.targetName }}.dmg
|
||
asset_name: ${{ env.targetName }}_${{ github.ref_name }}_${{ matrix.os }}_Qt${{ matrix.qt_ver }}_static_${{ env.RELEASE_OR_NIGHTLY }}.dmg
|
||
tag: ${{ github.ref }}
|
||
overwrite: true
|
||
|
||
build-ubuntu-shared:
|
||
name: Ubuntu (Shared Library)
|
||
runs-on: ${{ matrix.os }}
|
||
strategy:
|
||
matrix:
|
||
os: [ubuntu-latest]
|
||
qt_ver: [env.QT_VERSION]
|
||
qt_arch: [gcc_64]
|
||
env:
|
||
targetName: ${{ env.APP_NAME }}
|
||
steps:
|
||
- name: Check out repository
|
||
uses: actions/checkout@v4
|
||
with:
|
||
submodules: recursive
|
||
|
||
- name: Install Qt
|
||
uses: jurplel/install-qt-action@v3
|
||
with:
|
||
version: ${{ matrix.qt_ver }}
|
||
arch: ${{ matrix.qt_arch }}
|
||
modules: ${{ env.QT_MODULES }}
|
||
|
||
- name: Set up Ninja
|
||
uses: seanmiddleditch/gha-setup-ninja@v4
|
||
with:
|
||
version: 1.10.2
|
||
|
||
- name: ubuntu install GL library
|
||
run: sudo apt install -y libxcb-cursor0 libgl1-mesa-dev libxcb1-dev libgtk-3-dev libxkbcommon-x11-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-randr0-dev libxcb-shape0-dev libxcb-xfixes0-dev libxcb-xinerama0-dev libxcb-sync-dev libxcb-render-util0-dev libxcb-shm0-dev
|
||
|
||
- name: ubuntu install libfuse2
|
||
run: sudo apt install libfuse2
|
||
|
||
- name: build ubuntu
|
||
run: |
|
||
ninja --version
|
||
cmake --version
|
||
mkdir build
|
||
cd build
|
||
cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_PREFIX_PATH=/home/runner/work/${{ env.REPO_NAME }}/Qt/${{ matrix.qt_ver }}/gcc_64 -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Release -GNinja ..
|
||
cmake --build . --target all --config Release --parallel
|
||
|
||
- name: install QT linux deploy
|
||
uses: miurahr/install-linuxdeploy-action@v1
|
||
with:
|
||
plugins: qt appimage
|
||
|
||
- name: Check if svg file exists
|
||
run: if [ ! -f "${targetName}.svg" ]; then echo "File not found, creating..."; touch ${targetName}.svg; fi
|
||
|
||
- name: package
|
||
run: |
|
||
# make sure Qt plugin finds QML sources so it can deploy the imported files
|
||
export QML_SOURCES_PATHS=./
|
||
linuxdeploy-x86_64.AppImage --plugin=qt --output=appimage --create-desktop-file --icon-file=${targetName}.svg --executable=/home/runner/work/${{ env.REPO_NAME }}/${{ env.REPO_NAME }}/build/app/release/${targetName} --appdir /home/runner/work/${{ env.REPO_NAME }}/${{ env.REPO_NAME }}/build/app/release/
|
||
mv ${{ env.targetName }}-*.AppImage ${{ env.targetName }}_${{ matrix.os }}_${{matrix.qt_ver}}_shared_${{ env.RELEASE_OR_NIGHTLY }}.AppImage
|
||
|
||
- uses: actions/upload-artifact@v4
|
||
with:
|
||
name: ${{ env.targetName }}_${{ matrix.os }}_${{matrix.qt_ver}}_shared_${{ env.RELEASE_OR_NIGHTLY }}
|
||
path: ${{ env.targetName }}_${{ matrix.os }}_${{matrix.qt_ver}}_shared_${{ env.RELEASE_OR_NIGHTLY }}.AppImage
|
||
|
||
- name: uploadRelease
|
||
if: startsWith(github.event.ref, 'refs/tags/')
|
||
uses: svenstaro/upload-release-action@v2
|
||
with:
|
||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||
file: ${{ env.targetName }}_${{ matrix.os }}_${{matrix.qt_ver}}_shared_${{ env.RELEASE_OR_NIGHTLY }}.AppImage
|
||
asset_name: ${{ env.targetName }}_${{ github.ref_name }}_${{ matrix.os }}_Qt${{ matrix.qt_ver }}_shared_${{ env.RELEASE_OR_NIGHTLY }}.AppImage
|
||
tag: ${{ github.ref }}
|
||
overwrite: true
|
||
|
||
build-ubuntu-static:
|
||
name: Ubuntu (Static Library)
|
||
runs-on: ${{ matrix.os }}
|
||
strategy:
|
||
matrix:
|
||
os: [ubuntu-latest]
|
||
qt_ver: [env.QT_VERSION]
|
||
qt_arch: [gcc_64]
|
||
env:
|
||
targetName: ${{ env.APP_NAME }}
|
||
steps:
|
||
- name: Check out repository
|
||
uses: actions/checkout@v4
|
||
with:
|
||
submodules: recursive
|
||
|
||
- name: Install Qt
|
||
uses: jurplel/install-qt-action@v3
|
||
with:
|
||
version: ${{ matrix.qt_ver }}
|
||
arch: ${{ matrix.qt_arch }}
|
||
modules: ${{ env.QT_MODULES }}
|
||
|
||
- name: Set up Ninja
|
||
uses: seanmiddleditch/gha-setup-ninja@v4
|
||
with:
|
||
version: 1.10.2
|
||
|
||
- name: ubuntu install GL library
|
||
run: sudo apt-get install -y libxcb-cursor0 libgl1-mesa-dev libxcb1-dev libgtk-3-dev libxkbcommon-x11-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-randr0-dev libxcb-shape0-dev libxcb-xfixes0-dev libxcb-xinerama0-dev libxcb-sync-dev libxcb-render-util0-dev libxcb-shm0-dev
|
||
|
||
- name: ubuntu install libfuse2
|
||
run: sudo apt install libfuse2
|
||
|
||
- name: build ubuntu
|
||
run: |
|
||
ninja --version
|
||
cmake --version
|
||
mkdir build
|
||
cd build
|
||
cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_PREFIX_PATH=/home/runner/work/${{ env.REPO_NAME }}/Qt/${{ matrix.qt_ver }}/gcc_64 -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Release -D${{ env.REPO_NAME }}_BUILD_STATIC_LIB=ON -GNinja ..
|
||
cmake --build . --target all --config Release --parallel
|
||
|
||
- name: install QT linux deploy
|
||
uses: miurahr/install-linuxdeploy-action@v1
|
||
with:
|
||
plugins: qt appimage
|
||
|
||
- name: Check if svg file exists
|
||
run: if [ ! -f "${targetName}.svg" ]; then echo "File not found, creating..."; touch ${targetName}.svg; fi
|
||
|
||
- name: package
|
||
run: |
|
||
# make sure Qt plugin finds QML sources so it can deploy the imported files
|
||
export QML_SOURCES_PATHS=./
|
||
# 拷贝依赖
|
||
linuxdeploy-x86_64.AppImage --plugin=qt --output=appimage --create-desktop-file --icon-file=${targetName}.svg --executable=/home/runner/work/${{ env.REPO_NAME }}/${{ env.REPO_NAME }}/build/app/release/${targetName} --appdir /home/runner/work/${{ env.REPO_NAME }}/${{ env.REPO_NAME }}/build/app/release/
|
||
mv ${{ env.targetName }}-*.AppImage ${{ env.targetName }}_${{ matrix.os }}_Qt${{ matrix.qt_ver }}_static_${{ env.RELEASE_OR_NIGHTLY }}.AppImage
|
||
|
||
- uses: actions/upload-artifact@v4
|
||
with:
|
||
name: ${{ env.targetName }}_${{ matrix.os }}_Qt${{ matrix.qt_ver }}_static_${{ env.RELEASE_OR_NIGHTLY }}
|
||
path: ${{ env.targetName }}_${{ matrix.os }}_Qt${{ matrix.qt_ver }}_static_${{ env.RELEASE_OR_NIGHTLY }}.AppImage
|
||
|
||
- name: uploadRelease
|
||
if: startsWith(github.event.ref, 'refs/tags/')
|
||
uses: svenstaro/upload-release-action@v2
|
||
with:
|
||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||
file: ${{ env.targetName }}_${{ matrix.os }}_Qt${{ matrix.qt_ver }}_static_${{ env.RELEASE_OR_NIGHTLY }}.AppImage
|
||
asset_name: ${{ env.targetName }}_${{ github.ref_name }}_${{ matrix.os }}_Qt${{ matrix.qt_ver }}_static_${{ env.RELEASE_OR_NIGHTLY }}.AppImage
|
||
tag: ${{ github.ref }}
|
||
overwrite: true
|
||
|
||
build-win-mingw-shared:
|
||
name: Windows MinGW (Shared Library)
|
||
runs-on: windows-latest
|
||
strategy:
|
||
matrix:
|
||
include:
|
||
- qt_arch: win64_mingw
|
||
qt_ver: ${{ env.QT_VERSION }}
|
||
qt_tools: "tools_mingw,9.0.0-1-202203221220,qt.tools.win64_mingw900"
|
||
qt_tools_mingw_install: mingw900_64
|
||
env:
|
||
targetName: ${{ env.APP_NAME }}.exe
|
||
fileName: ${{ env.APP_NAME }}
|
||
steps:
|
||
- name: Check out repository
|
||
uses: actions/checkout@v4
|
||
with:
|
||
submodules: recursive
|
||
|
||
- name: Setup ninja
|
||
uses: seanmiddleditch/gha-setup-ninja@v4
|
||
with:
|
||
version: 1.10.2
|
||
|
||
- name: Install Qt
|
||
uses: jurplel/install-qt-action@v3
|
||
with:
|
||
version: ${{ matrix.qt_ver }}
|
||
arch: ${{ matrix.qt_arch }}
|
||
modules: ${{ env.QT_MODULES }}
|
||
|
||
- name: Qt6 environment configuration
|
||
if: ${{ startsWith( matrix.qt_ver, 6 ) }}
|
||
shell: pwsh
|
||
run: |
|
||
Write-Output "${{ env.Qt6_DIR }}/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
||
Write-Output "${{ env.Qt6_DIR }}/../../Tools/${{ matrix.qt_tools_mingw_install }}/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
||
|
||
- name: where is cmake & where is mingw32-make
|
||
shell: pwsh
|
||
run: |
|
||
Get-Command -Name 'cmake' | Format-List
|
||
Get-Command -Name 'mingw32-make' | Format-List
|
||
|
||
- name: mingw-build
|
||
id: build
|
||
shell: cmd
|
||
run: |
|
||
mkdir build
|
||
cd build
|
||
cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_PREFIX_PATH=D:\a\${{ env.REPO_NAME }}\Qt\${{ matrix.qt_ver }}\mingw_64 -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Release -GNinja ..
|
||
cmake --build . --target all --config Release --parallel
|
||
|
||
- name: package
|
||
id: package
|
||
env:
|
||
archiveName: ${{ env.fileName }}_${{ matrix.qt_arch }}_${{ matrix.qt_ver }}_shared_${{ env.RELEASE_OR_NIGHTLY }}
|
||
shell: pwsh
|
||
run: |
|
||
& scripts\windows-mingw-publish.ps1 ${env:archiveName} ${env:targetName}
|
||
$name = ${env:archiveName}
|
||
echo "packageName=$name" >> $env:GITHUB_OUTPUT
|
||
|
||
- uses: actions/upload-artifact@v4
|
||
with:
|
||
name: ${{ steps.package.outputs.packageName }}
|
||
path: ${{ steps.package.outputs.packageName }}
|
||
|
||
- name: uploadRelease
|
||
if: startsWith(github.event.ref, 'refs/tags/')
|
||
uses: svenstaro/upload-release-action@v2
|
||
with:
|
||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||
file: ${{ steps.package.outputs.packageName }}.zip
|
||
asset_name: ${{ env.fileName }}_${{ github.ref_name }}_${{ matrix.qt_arch }}_Qt${{ matrix.qt_ver }}_shared_${{ env.RELEASE_OR_NIGHTLY }}.zip
|
||
tag: ${{ github.ref }}
|
||
overwrite: true
|
||
|
||
build-win-mingw-static:
|
||
name: Windows MinGW (Static Library)
|
||
runs-on: windows-latest
|
||
strategy:
|
||
matrix:
|
||
include:
|
||
- qt_arch: win64_mingw
|
||
qt_ver: ${{ env.QT_VERSION }}
|
||
qt_tools: "tools_mingw,9.0.0-1-202203221220,qt.tools.win64_mingw900"
|
||
qt_tools_mingw_install: mingw900_64
|
||
env:
|
||
targetName: ${{ env.APP_NAME }}.exe
|
||
fileName: ${{ env.APP_NAME }}
|
||
steps:
|
||
- name: Check out repository
|
||
uses: actions/checkout@v4
|
||
with:
|
||
submodules: recursive
|
||
|
||
- name: Setup ninja
|
||
uses: seanmiddleditch/gha-setup-ninja@v4
|
||
with:
|
||
version: 1.10.2
|
||
|
||
- name: Install Qt
|
||
uses: jurplel/install-qt-action@v3
|
||
with:
|
||
version: ${{ matrix.qt_ver }}
|
||
arch: ${{ matrix.qt_arch }}
|
||
modules: ${{ env.QT_MODULES }}
|
||
|
||
- name: Qt6 environment configuration
|
||
if: ${{ startsWith( matrix.qt_ver, 6 ) }}
|
||
shell: pwsh
|
||
run: |
|
||
Write-Output "${{ env.Qt6_DIR }}/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
||
Write-Output "${{ env.Qt6_DIR }}/../../Tools/${{ matrix.qt_tools_mingw_install }}/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
||
|
||
- name: where is cmake & where is mingw32-make
|
||
shell: pwsh
|
||
run: |
|
||
Get-Command -Name 'cmake' | Format-List
|
||
Get-Command -Name 'mingw32-make' | Format-List
|
||
|
||
- name: mingw-build
|
||
id: build
|
||
shell: cmd
|
||
run: |
|
||
mkdir build
|
||
cd build
|
||
cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_PREFIX_PATH=D:\a\${{ env.REPO_NAME }}\Qt\${{ matrix.qt_ver }}\mingw_64 -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Release -D${{ env.REPO_NAME }}_BUILD_STATIC_LIB=ON -GNinja ..
|
||
cmake --build . --target all --config Release --parallel
|
||
|
||
- name: package
|
||
id: package
|
||
env:
|
||
archiveName: ${{ env.fileName }}_${{ matrix.qt_arch }}_${{ matrix.qt_ver }}_static_${{ env.RELEASE_OR_NIGHTLY }}
|
||
shell: pwsh
|
||
run: |
|
||
& scripts\windows-mingw-publish.ps1 ${env:archiveName} ${env:targetName}
|
||
$name = ${env:archiveName}
|
||
echo "packageName=$name" >> $env:GITHUB_OUTPUT
|
||
|
||
- uses: actions/upload-artifact@v4
|
||
with:
|
||
name: ${{ steps.package.outputs.packageName }}
|
||
path: ${{ steps.package.outputs.packageName }}
|
||
|
||
- name: uploadRelease
|
||
if: startsWith(github.event.ref, 'refs/tags/')
|
||
uses: svenstaro/upload-release-action@v2
|
||
with:
|
||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||
file: ${{ steps.package.outputs.packageName }}.zip
|
||
asset_name: ${{ env.fileName }}_${{ github.ref_name }}_${{ matrix.qt_arch }}_Qt${{ matrix.qt_ver }}_static_${{ env.RELEASE_OR_NIGHTLY }}.zip
|
||
tag: ${{ github.ref }}
|
||
overwrite: true
|
||
|
||
build-win-msvc-shared:
|
||
name: Windows MSVC (Shared Library)
|
||
runs-on: ${{ matrix.os }}
|
||
strategy:
|
||
matrix:
|
||
os: [windows-latest]
|
||
include:
|
||
- qt_ver: ${{ env.QT_VERSION }}
|
||
qt_arch: win64_msvc2019_64
|
||
msvc_arch: x64
|
||
qt_arch_install: msvc2019_64
|
||
env:
|
||
targetName: ${{ env.APP_NAME }}.exe
|
||
fileName: ${{ env.APP_NAME }}
|
||
steps:
|
||
- name: Check out repository
|
||
uses: actions/checkout@v4
|
||
with:
|
||
submodules: recursive
|
||
|
||
- name: Setup ninja
|
||
uses: seanmiddleditch/gha-setup-ninja@v4
|
||
with:
|
||
version: 1.10.2
|
||
|
||
- name: Install Qt
|
||
uses: jurplel/install-qt-action@v3
|
||
with:
|
||
version: ${{ matrix.qt_ver }}
|
||
arch: ${{ matrix.qt_arch }}
|
||
modules: ${{ env.QT_MODULES }}
|
||
|
||
- name: msvc-build
|
||
id: build
|
||
shell: cmd
|
||
run: |
|
||
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.msvc_arch }}
|
||
mkdir build
|
||
cd build
|
||
cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_PREFIX_PATH=D:\a\${{ env.REPO_NAME }}\Qt\${{ matrix.qt_ver }}\msvc2019_64 -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl -DCMAKE_BUILD_TYPE=Release -GNinja ..
|
||
cmake --build . --target all --config Release --parallel
|
||
echo winSdkDir=%WindowsSdkDir% >> %GITHUB_ENV%
|
||
echo winSdkVer=%WindowsSdkVersion% >> %GITHUB_ENV%
|
||
echo vcToolsInstallDir=%VCToolsInstallDir% >> %GITHUB_ENV%
|
||
echo vcToolsRedistDir=%VCToolsRedistDir% >> %GITHUB_ENV%
|
||
|
||
- name: package
|
||
id: package
|
||
env:
|
||
archiveName: ${{ env.fileName }}_${{ matrix.qt_arch }}_${{ matrix.qt_ver }}_shared_${{ env.RELEASE_OR_NIGHTLY }}
|
||
msvcArch: ${{ matrix.msvc_arch }}
|
||
shell: pwsh
|
||
run: |
|
||
& scripts\windows-publish.ps1 ${env:archiveName} ${env:targetName}
|
||
$name = ${env:archiveName}
|
||
echo "packageName=$name" >> $env:GITHUB_OUTPUT
|
||
|
||
- uses: actions/upload-artifact@v4
|
||
with:
|
||
name: ${{ steps.package.outputs.packageName }}
|
||
path: ${{ steps.package.outputs.packageName }}
|
||
|
||
- name: uploadRelease
|
||
if: startsWith(github.event.ref, 'refs/tags/')
|
||
uses: svenstaro/upload-release-action@v2
|
||
with:
|
||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||
file: ${{ steps.package.outputs.packageName }}.zip
|
||
asset_name: ${{ env.fileName }}_${{ github.ref_name }}_${{ matrix.qt_arch }}_Qt${{ matrix.qt_ver }}_shared_${{ env.RELEASE_OR_NIGHTLY }}.zip
|
||
tag: ${{ github.ref }}
|
||
overwrite: true
|
||
|
||
build-win-msvc-static:
|
||
name: Windows MSVC (Static Library)
|
||
runs-on: ${{ matrix.os }}
|
||
strategy:
|
||
matrix:
|
||
os: [windows-latest]
|
||
include:
|
||
- qt_ver: ${{ env.QT_VERSION }}
|
||
qt_arch: win64_msvc2019_64
|
||
msvc_arch: x64
|
||
qt_arch_install: msvc2019_64
|
||
env:
|
||
targetName: ${{ env.APP_NAME }}.exe
|
||
fileName: ${{ env.APP_NAME }}
|
||
steps:
|
||
- name: Check out repository
|
||
uses: actions/checkout@v4
|
||
with:
|
||
submodules: recursive
|
||
|
||
- name: Setup ninja
|
||
uses: seanmiddleditch/gha-setup-ninja@v4
|
||
with:
|
||
version: 1.10.2
|
||
|
||
- name: Install Qt
|
||
uses: jurplel/install-qt-action@v3
|
||
with:
|
||
version: ${{ matrix.qt_ver }}
|
||
arch: ${{ matrix.qt_arch }}
|
||
modules: ${{ env.QT_MODULES }}
|
||
|
||
- name: msvc-build
|
||
id: build
|
||
shell: cmd
|
||
run: |
|
||
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.msvc_arch }}
|
||
mkdir build
|
||
cd build
|
||
cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_PREFIX_PATH=D:\a\${{ env.REPO_NAME }}\Qt\${{ matrix.qt_ver }}\msvc2019_64 -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl -DCMAKE_BUILD_TYPE=Release -D${{ env.REPO_NAME }}_BUILD_STATIC_LIB=ON -GNinja ..
|
||
cmake --build . --target all --config Release --parallel
|
||
echo winSdkDir=%WindowsSdkDir% >> %GITHUB_ENV%
|
||
echo winSdkVer=%WindowsSdkVersion% >> %GITHUB_ENV%
|
||
echo vcToolsInstallDir=%VCToolsInstallDir% >> %GITHUB_ENV%
|
||
echo vcToolsRedistDir=%VCToolsRedistDir% >> %GITHUB_ENV%
|
||
|
||
- name: package
|
||
id: package
|
||
env:
|
||
archiveName: ${{ env.fileName }}_${{ matrix.qt_arch }}_${{ matrix.qt_ver }}_static_${{ env.RELEASE_OR_NIGHTLY }}
|
||
msvcArch: ${{ matrix.msvc_arch }}
|
||
shell: pwsh
|
||
run: |
|
||
& scripts\windows-publish.ps1 ${env:archiveName} ${env:targetName}
|
||
$name = ${env:archiveName}
|
||
echo "packageName=$name" >> $env:GITHUB_OUTPUT
|
||
|
||
- uses: actions/upload-artifact@v4
|
||
with:
|
||
name: ${{ steps.package.outputs.packageName }}
|
||
path: ${{ steps.package.outputs.packageName }}
|
||
|
||
- name: uploadRelease
|
||
if: startsWith(github.event.ref, 'refs/tags/')
|
||
uses: svenstaro/upload-release-action@v2
|
||
with:
|
||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||
file: ${{ steps.package.outputs.packageName }}.zip
|
||
asset_name: ${{ env.fileName }}_${{ github.ref_name }}_${{ matrix.qt_arch }}_Qt${{ matrix.qt_ver }}_static_${{ env.RELEASE_OR_NIGHTLY }}.zip
|
||
tag: ${{ github.ref }}
|
||
overwrite: true
|