189 lines
6.8 KiB
YAML
189 lines
6.8 KiB
YAML
name: Gallery App Build
|
|
on:
|
|
push:
|
|
paths:
|
|
- '*.txt'
|
|
- 'FluentUI/**'
|
|
- 'Gallery/**'
|
|
- '.github/workflows/app_build_workflow.yml'
|
|
pull_request:
|
|
paths:
|
|
- '*.txt'
|
|
- 'FluentUI/**'
|
|
- 'Gallery/**'
|
|
- '.github/workflows/app_build_workflow.yml'
|
|
|
|
|
|
env:
|
|
REPO_NAME: ${{ github.event.repository.name }}
|
|
APP_NAME: FluentUI-Gallery
|
|
QT_VERSION: 6.7.2
|
|
QT_MODULES: qtshadertools qtimageformats
|
|
QT_ARCH_MAC: clang_64
|
|
QT_ARCH_WIN_MINGW: win64_mingw
|
|
QT_ARCH_WIN_MSVC: win64_msvc2019_64
|
|
QT_ARCH_LINUX: linux_gcc_64
|
|
QT_MINGW_TOOLS: "tools_cmake,qt.tools.cmake tools_mingw90,qt.tools.win64_mingw900"
|
|
QT_MINGW_TOOLS_INSTALL: mingw1120_64
|
|
QT_MSVC_ARCH: x64
|
|
QT_MSVC_TOOLS: "tools_cmake,qt.tools.cmake"
|
|
QT_MSVC_TOOLS_INSTALL: msvc2019_64
|
|
OS_MAC: macos-14
|
|
OS_WIN: windows-2019
|
|
OS_LINUX: ubuntu-20.04
|
|
RELEASE_OR_NIGHTLY: ${{ startsWith(github.ref, 'refs/tags/v') && 'RELEASE' || 'NIGHTLY' }}
|
|
|
|
jobs:
|
|
|
|
build-win:
|
|
name: Windows
|
|
runs-on: windows-2019
|
|
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@v4
|
|
with:
|
|
version: ${{ env.QT_VERSION }}
|
|
arch: ${{ env.QT_ARCH_WIN_MSVC }}
|
|
modules: ${{ env.QT_MODULES }}
|
|
|
|
- name: msvc-build
|
|
id: build
|
|
shell: cmd
|
|
run: |
|
|
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ${{ env.QT_MSVC_ARCH }}
|
|
mkdir build
|
|
cd build
|
|
cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_PREFIX_PATH=D:/a/${{ env.REPO_NAME }}/Qt/${{ env.QT_VERSION }}/msvc2019_64 -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl -DCMAKE_BUILD_TYPE=Release -GNinja ..
|
|
cmake --build . --target all --config Release --parallel
|
|
cmake --build . --target Gallery_dist
|
|
|
|
- name: Install Inno Setup
|
|
uses: zhuzichu520/inno-setup-action@v1.0.1
|
|
with:
|
|
filepath: ./package/InstallerScript.iss
|
|
|
|
- uses: actions/upload-artifact@v4
|
|
with:
|
|
name: ${{ env.APP_NAME }}_${{ env.OS_WIN }}_Qt${{ env.QT_VERSION }}
|
|
path: ./package/installer.exe
|
|
|
|
- name: uploadRelease
|
|
if: startsWith(github.event.ref, 'refs/tags/')
|
|
uses: svenstaro/upload-release-action@v2
|
|
with:
|
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
|
file: ./package/installer.exe
|
|
asset_name: ${{ env.APP_NAME }}_${{ github.ref_name }}_${{ env.OS_WIN }}_Qt${{ env.QT_VERSION }}.exe
|
|
tag: ${{ github.ref }}
|
|
overwrite: true
|
|
|
|
build-macos:
|
|
name: macOS
|
|
runs-on: macos-14
|
|
steps:
|
|
- name: Check out repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
submodules: recursive
|
|
|
|
- name: Install Qt
|
|
uses: jurplel/install-qt-action@v4
|
|
with:
|
|
version: ${{ env.QT_VERSION }}
|
|
arch: ${{ env.QT_ARCH_MAC }}
|
|
modules: ${{ env.QT_MODULES }}
|
|
|
|
- name: Set up Ninja
|
|
uses: seanmiddleditch/gha-setup-ninja@v4
|
|
with:
|
|
version: 1.10.2
|
|
|
|
- name: build macos
|
|
run: |
|
|
mkdir build
|
|
cd build
|
|
cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_PREFIX_PATH=/Users/runner/work/${{ env.REPO_NAME }}/Qt/${{ env.QT_VERSION }}/macos -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Release -GNinja ..
|
|
cmake --build . --target all --config Release --parallel
|
|
cmake --build . --target Gallery_dist
|
|
|
|
- uses: actions/upload-artifact@v4
|
|
with:
|
|
name: ${{ env.APP_NAME }}_${{ env.OS_MAC }}_Qt${{ env.QT_VERSION }}
|
|
path: ./dist/${{ env.APP_NAME }}.dmg
|
|
|
|
- name: uploadRelease
|
|
if: startsWith(github.event.ref, 'refs/tags/')
|
|
uses: svenstaro/upload-release-action@v2
|
|
with:
|
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
|
file: ./dist/${{ env.APP_NAME }}.dmg
|
|
asset_name: ${{ env.APP_NAME }}_${{ github.ref_name }}_${{ env.OS_MAC }}_Qt${{ env.QT_VERSION }}.dmg
|
|
tag: ${{ github.ref }}
|
|
overwrite: true
|
|
|
|
build-ubuntu:
|
|
name: Ubuntu
|
|
runs-on: ubuntu-20.04
|
|
steps:
|
|
- name: Check out repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
submodules: recursive
|
|
|
|
- name: Install Qt
|
|
uses: jurplel/install-qt-action@v4
|
|
with:
|
|
version: ${{ env.QT_VERSION }}
|
|
arch: ${{ env.QT_ARCH_LINUX }}
|
|
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: |
|
|
mkdir build
|
|
cd build
|
|
rm -rf /home/runner/work/${{ env.REPO_NAME }}/Qt/${{ env.QT_VERSION }}/gcc_64/plugins/sqldrivers/libqsqlmimer.so
|
|
rm -rf /home/runner/work/${{ env.REPO_NAME }}/Qt/${{ env.QT_VERSION }}/gcc_64/plugins/sqldrivers/libqsqlmysql.so
|
|
cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_PREFIX_PATH=/home/runner/work/${{ env.REPO_NAME }}/Qt/${{ env.QT_VERSION }}/gcc_64 -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Release -GNinja ..
|
|
cmake --build . --target all --config Release --parallel
|
|
cmake --build . --target Gallery_dist
|
|
|
|
- name: package
|
|
run: |
|
|
dpkg -b ./package ${{ env.APP_NAME }}_${{ env.OS_LINUX }}_Qt${{ env.QT_VERSION }}.deb
|
|
|
|
- uses: actions/upload-artifact@v4
|
|
with:
|
|
name: ${{ env.APP_NAME }}_${{ env.OS_LINUX }}_Qt${{ env.QT_VERSION }}
|
|
path: ./${{ env.APP_NAME }}_${{ env.OS_LINUX }}_Qt${{ env.QT_VERSION }}.deb
|
|
|
|
- name: uploadRelease
|
|
if: startsWith(github.event.ref, 'refs/tags/')
|
|
uses: svenstaro/upload-release-action@v2
|
|
with:
|
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
|
file: ./${{ env.APP_NAME }}_${{ env.OS_LINUX }}_Qt${{ env.QT_VERSION }}.deb
|
|
asset_name: ${{ env.APP_NAME }}_${{ github.ref_name }}_${{ env.OS_LINUX }}_Qt${{ env.QT_VERSION }}.deb
|
|
tag: ${{ github.ref }}
|
|
overwrite: true
|