From 35aff1254c039e347c6e4156fad6b4c59ede5276 Mon Sep 17 00:00:00 2001 From: Mentalflow <312902918@qq.com> Date: Thu, 9 May 2024 17:14:34 +0800 Subject: [PATCH] Workflows: Add app_build_workflow and remove old workflows. --- .github/workflows/app_build_workflow.yml | 588 +++++++++++++++++++++ .github/workflows/macos-shared.yml | 77 --- .github/workflows/macos-static.yml | 77 --- .github/workflows/ubuntu-shared.yml | 94 ---- .github/workflows/ubuntu-static.yml | 94 ---- .github/workflows/windows-mingw-shared.yml | 97 ---- .github/workflows/windows-mingw-static.yml | 97 ---- .github/workflows/windows-msvc-shared.yml | 91 ---- .github/workflows/windows-msvc-static.yml | 91 ---- 9 files changed, 588 insertions(+), 718 deletions(-) create mode 100644 .github/workflows/app_build_workflow.yml delete mode 100644 .github/workflows/macos-shared.yml delete mode 100644 .github/workflows/macos-static.yml delete mode 100644 .github/workflows/ubuntu-shared.yml delete mode 100644 .github/workflows/ubuntu-static.yml delete mode 100644 .github/workflows/windows-mingw-shared.yml delete mode 100644 .github/workflows/windows-mingw-static.yml delete mode 100644 .github/workflows/windows-msvc-shared.yml delete mode 100644 .github/workflows/windows-msvc-static.yml diff --git a/.github/workflows/app_build_workflow.yml b/.github/workflows/app_build_workflow.yml new file mode 100644 index 0000000..16c5aa0 --- /dev/null +++ b/.github/workflows/app_build_workflow.yml @@ -0,0 +1,588 @@ +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 diff --git a/.github/workflows/macos-shared.yml b/.github/workflows/macos-shared.yml deleted file mode 100644 index 7ce1847..0000000 --- a/.github/workflows/macos-shared.yml +++ /dev/null @@ -1,77 +0,0 @@ -name: MacOS (Shared Library) -on: - push: - paths: - - '*.txt' - - 'example/**' - - 'lib_source/**' - - 'scripts/**' - - '3rdparty/**' - - '.github/workflows/macos-shared.yml' - pull_request: - paths: - - '*.txt' - - 'example/**' - - 'lib_source/**' - - 'scripts/**' - - '3rdparty/**' - - '.github/workflows/macos-shared.yml' - -jobs: - build: - name: Build - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [macos-14] - qt_ver: [6.6.3] - qt_arch: [clang_64] - env: - targetName: RibbonUI-APP - 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: 'qt5compat qtmultimedia qtshadertools qtimageformats' - - - 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/RibbonUI/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/RibbonUI/Qt/${{ matrix.qt_ver }}/macos/qml -name "*.dSYM" | xargs rm -r - # 拷贝依赖 - sudo macdeployqt /Users/runner/work/RibbonUI/RibbonUI/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/RibbonUI/RibbonUI/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/RibbonUI/RibbonUI/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 diff --git a/.github/workflows/macos-static.yml b/.github/workflows/macos-static.yml deleted file mode 100644 index 2bb970b..0000000 --- a/.github/workflows/macos-static.yml +++ /dev/null @@ -1,77 +0,0 @@ -name: MacOS (Static Library) -on: - push: - paths: - - '*.txt' - - 'example/**' - - 'lib_source/**' - - 'scripts/**' - - '3rdparty/**' - - '.github/workflows/macos-static.yml' - pull_request: - paths: - - '*.txt' - - 'example/**' - - 'lib_source/**' - - 'scripts/**' - - '3rdparty/**' - - '.github/workflows/macos-static.yml' - -jobs: - build: - name: Build - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [macos-14] - qt_ver: [6.6.3] - qt_arch: [clang_64] - env: - targetName: RibbonUI-APP - 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: 'qt5compat qtmultimedia qtshadertools qtimageformats' - - - 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/RibbonUI/Qt/${{ matrix.qt_ver }}/macos -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Release -DRIBBONUI_BUILD_STATIC_LIB=ON -GNinja .. - cmake --build . --target all --config Release --parallel - - - name: package - run: | - # 先删除所有dSYM文件,减少包的体积 - sudo find /Users/runner/work/RibbonUI/Qt/${{ matrix.qt_ver }}/macos/qml -name "*.dSYM" | xargs rm -r - # 拷贝依赖 - sudo macdeployqt /Users/runner/work/RibbonUI/RibbonUI/build/app/release/${targetName}.app -qmldir=. -verbose=1 -dmg - - - uses: actions/upload-artifact@v4 - with: - name: ${{ env.targetName }}_${{ matrix.os }}_${{matrix.qt_ver}}_static - path: /Users/runner/work/RibbonUI/RibbonUI/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/RibbonUI/RibbonUI/build/app/release/${{ env.targetName }}.dmg - asset_name: ${{ env.targetName }}_${{ github.ref_name }}_${{ matrix.os }}_Qt${{ matrix.qt_ver }}_static.dmg - tag: ${{ github.ref }} - overwrite: true diff --git a/.github/workflows/ubuntu-shared.yml b/.github/workflows/ubuntu-shared.yml deleted file mode 100644 index 2221bd7..0000000 --- a/.github/workflows/ubuntu-shared.yml +++ /dev/null @@ -1,94 +0,0 @@ -name: Ubuntu (Shared Library) -on: - workflow_dispatch: - push: - paths: - - '*.txt' - - 'lib_source/**' - - 'example/**' - - 'scripts/**' - - '3rdparty/**' - - '.github/workflows/ubuntu-shared.yml' - pull_request: - paths: - - '*.txt' - - 'lib_source/**' - - 'example/**' - - 'scripts/**' - - '3rdparty/**' - - '.github/workflows/ubuntu-shared.yml' - -jobs: - build: - name: Build - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest] - qt_ver: [6.6.3] - qt_arch: [gcc_64] - env: - targetName: RibbonUI-APP - 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: 'qt5compat qtmultimedia qtshadertools qtimageformats' - - - 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/RibbonUI/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/RibbonUI/RibbonUI/build/app/release/${targetName} --appdir /home/runner/work/RibbonUI/RibbonUI/build/app/release/ - mv ${{ env.targetName }}-*.AppImage ${{ env.targetName }}_${{ matrix.os }}_${{matrix.qt_ver}}_shared.AppImage - - - uses: actions/upload-artifact@v4 - with: - name: ${{ env.targetName }}_${{ matrix.os }}_${{matrix.qt_ver}}_shared - path: ${{ env.targetName }}_${{ matrix.os }}_${{matrix.qt_ver}}_shared.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.AppImage - asset_name: ${{ env.targetName }}_${{ github.ref_name }}_${{ matrix.os }}_Qt${{ matrix.qt_ver }}_shared.AppImage - tag: ${{ github.ref }} - overwrite: true diff --git a/.github/workflows/ubuntu-static.yml b/.github/workflows/ubuntu-static.yml deleted file mode 100644 index 016025e..0000000 --- a/.github/workflows/ubuntu-static.yml +++ /dev/null @@ -1,94 +0,0 @@ -name: Ubuntu (Static Library) -on: - workflow_dispatch: - push: - paths: - - '*.txt' - - 'lib_source/**' - - 'example/**' - - 'scripts/**' - - '3rdparty/**' - - '.github/workflows/ubuntu-static.yml' - pull_request: - paths: - - '*.txt' - - 'lib_source/**' - - 'example/**' - - 'scripts/**' - - '3rdparty/**' - - '.github/workflows/ubuntu-static.yml' - -jobs: - build: - name: Build - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest] - qt_ver: [6.6.3] - qt_arch: [gcc_64] - env: - targetName: RibbonUI-APP - 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: 'qt5compat qtmultimedia qtshadertools qtimageformats' - - - 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/RibbonUI/Qt/${{ matrix.qt_ver }}/gcc_64 -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Release -DRIBBONUI_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/RibbonUI/RibbonUI/build/app/release/${targetName} --appdir /home/runner/work/RibbonUI/RibbonUI/build/app/release/ - mv ${{ env.targetName }}-*.AppImage ${{ env.targetName }}_${{ matrix.os }}_Qt${{ matrix.qt_ver }}_static.AppImage - - - uses: actions/upload-artifact@v4 - with: - name: ${{ env.targetName }}_${{ matrix.os }}_Qt${{ matrix.qt_ver }}_static - path: ${{ env.targetName }}_${{ matrix.os }}_Qt${{ matrix.qt_ver }}_static.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.AppImage - asset_name: ${{ env.targetName }}_${{ github.ref_name }}_${{ matrix.os }}_Qt${{ matrix.qt_ver }}_static.AppImage - tag: ${{ github.ref }} - overwrite: true diff --git a/.github/workflows/windows-mingw-shared.yml b/.github/workflows/windows-mingw-shared.yml deleted file mode 100644 index 9384025..0000000 --- a/.github/workflows/windows-mingw-shared.yml +++ /dev/null @@ -1,97 +0,0 @@ -name: Windows MinGW (Shared Library) -on: - push: - paths: - - '*.txt' - - 'lib_source/**' - - 'example/**' - - 'scripts/**' - - '3rdparty/**' - - '.github/workflows/windows-mingw-shared.yml' - pull_request: - paths: - - '*.txt' - - 'example/**' - - 'lib_source/**' - - 'scripts/**' - - '3rdparty/**' - - '.github/workflows/windows-mingw-shared.yml' - -jobs: - build: - name: Build - runs-on: windows-latest - strategy: - matrix: - include: - - qt_arch: win64_mingw - qt_ver: 6.6.3 - qt_tools: "tools_mingw,9.0.0-1-202203221220,qt.tools.win64_mingw900" - qt_tools_mingw_install: mingw900_64 - env: - targetName: RibbonUI-APP.exe - fileName: RibbonUI-APP - 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: 'qt5compat qtmultimedia qtshadertools qtimageformats' - - - 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\RibbonUI\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 - 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.zip - tag: ${{ github.ref }} - overwrite: true diff --git a/.github/workflows/windows-mingw-static.yml b/.github/workflows/windows-mingw-static.yml deleted file mode 100644 index 35114cf..0000000 --- a/.github/workflows/windows-mingw-static.yml +++ /dev/null @@ -1,97 +0,0 @@ -name: Windows MinGW (Static Library) -on: - push: - paths: - - '*.txt' - - 'lib_source/**' - - 'example/**' - - 'scripts/**' - - '3rdparty/**' - - '.github/workflows/windows-mingw-static.yml' - pull_request: - paths: - - '*.txt' - - 'example/**' - - 'lib_source/**' - - 'scripts/**' - - '3rdparty/**' - - '.github/workflows/windows-mingw-static.yml' - -jobs: - build: - name: Build - runs-on: windows-latest - strategy: - matrix: - include: - - qt_arch: win64_mingw - qt_ver: 6.6.3 - qt_tools: "tools_mingw,9.0.0-1-202203221220,qt.tools.win64_mingw900" - qt_tools_mingw_install: mingw900_64 - env: - targetName: RibbonUI-APP.exe - fileName: RibbonUI-APP - 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: 'qt5compat qtmultimedia qtshadertools qtimageformats' - - - 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\RibbonUI\Qt\${{ matrix.qt_ver }}\mingw_64 -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Release -DRIBBONUI_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 - 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.zip - tag: ${{ github.ref }} - overwrite: true diff --git a/.github/workflows/windows-msvc-shared.yml b/.github/workflows/windows-msvc-shared.yml deleted file mode 100644 index 99e694e..0000000 --- a/.github/workflows/windows-msvc-shared.yml +++ /dev/null @@ -1,91 +0,0 @@ -name: Windows MSVC (Shared Library) -on: - push: - paths: - - '*.txt' - - 'lib_source/**' - - 'example/**' - - 'scripts/**' - - '3rdparty/**' - - '.github/workflows/windows-msvc-shared.yml' - pull_request: - paths: - - '*.txt' - - 'example/**' - - 'lib_source/**' - - 'scripts/**' - - '3rdparty/**' - - '.github/workflows/windows-msvc-shared.yml' - -jobs: - build: - name: Build - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [windows-latest] - include: - - qt_ver: 6.6.3 - qt_arch: win64_msvc2019_64 - msvc_arch: x64 - qt_arch_install: msvc2019_64 - env: - targetName: RibbonUI-APP.exe - fileName: RibbonUI-APP - 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: 'qt5compat qtmultimedia qtshadertools qtimageformats' - - - 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\RibbonUI\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 - 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.zip - tag: ${{ github.ref }} - overwrite: true diff --git a/.github/workflows/windows-msvc-static.yml b/.github/workflows/windows-msvc-static.yml deleted file mode 100644 index ad4cb02..0000000 --- a/.github/workflows/windows-msvc-static.yml +++ /dev/null @@ -1,91 +0,0 @@ -name: Windows MSVC (Static Library) -on: - push: - paths: - - '*.txt' - - 'lib_source/**' - - 'example/**' - - 'scripts/**' - - '3rdparty/**' - - '.github/workflows/windows-msvc-static.yml' - pull_request: - paths: - - '*.txt' - - 'example/**' - - 'lib_source/**' - - 'scripts/**' - - '3rdparty/**' - - '.github/workflows/windows-msvc-static.yml' - -jobs: - build: - name: Build - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [windows-latest] - include: - - qt_ver: 6.6.3 - qt_arch: win64_msvc2019_64 - msvc_arch: x64 - qt_arch_install: msvc2019_64 - env: - targetName: RibbonUI-APP.exe - fileName: RibbonUI-APP - 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: 'qt5compat qtmultimedia qtshadertools qtimageformats' - - - 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\RibbonUI\Qt\${{ matrix.qt_ver }}\msvc2019_64 -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl -DCMAKE_BUILD_TYPE=Release -DRIBBONUI_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 - 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.zip - tag: ${{ github.ref }} - overwrite: true