Trying CI QT 6.7.2 #122
This file contains 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: Build platforms | |
on: | |
push: | |
branches: | |
- main | |
env: | |
VERSION_NUMBER: 1.1 | |
QT_VERSION: 6.7.2 | |
PROJECT: "LetItOut" | |
QT_PATH: D:\a\LetItOut\LetItOut\Qt | |
MINGW_VERSION: mingw1120_64 | |
permissions: | |
id-token: "write" | |
contents: "write" | |
packages: "write" | |
pull-requests: "read" | |
jobs: | |
build-windows: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Install Qt | |
uses: jurplel/install-qt-action@v4 | |
with: | |
version: '${{ env.QT_VERSION }}' | |
host: 'windows' | |
target: 'desktop' | |
arch: 'win64_mingw' | |
dir: '${{ github.workspace }}/' | |
install-deps: 'true' | |
cache: 'true' | |
cache-key-prefix: 'install-qt-action' | |
setup-python: 'true' | |
tools: 'tools_ifw tools_cmake tools_mingw90 tools_ninja' | |
archives: 'qttools qtbase MinGW' | |
set-env: 'true' | |
tools-only: 'false' | |
aqtversion: '==3.1.*' | |
py7zrversion: '==0.20.*' | |
extra: '--external 7z' | |
- name: Build | |
shell: cmd | |
run: | | |
dir | |
mkdir build | |
"${{ env.IQTA_TOOLS }}\CMake_64\bin\cmake.exe" -S . -B build "-GMinGW Makefiles" "-DCMAKE_BUILD_TYPE:STRING=Release" "-DQT_QMAKE_EXECUTABLE:FILEPATH=${{ env.Qt6_DIR }}/bin/qmake.exe" "-DCMAKE_PREFIX_PATH:PATH=${{ env.Qt6_DIR }}" "-DCMAKE_C_COMPILER:FILEPATH=${{ env.IQTA_TOOLS }}/${{ env.MINGW_VERSION }}/bin/gcc.exe" "-DCMAKE_CXX_COMPILER:FILEPATH=${{ env.IQTA_TOOLS }}/${{ env.MINGW_VERSION }}/bin/g++.exe" | |
cmake --build build | |
- name: Deploy | |
shell: cmd | |
run: | | |
"${{ env.Qt6_DIR }}\bin\windeployqt.exe" build/${{ env.PROJECT }}.exe | |
copy "${{ env.Qt6_DIR }}\bin\libgcc_s_seh-1.dll" build | |
copy "${{ env.Qt6_DIR }}\bin\libstdc++-6.dll" build | |
copy "${{ env.Qt6_DIR }}\bin\libwinpthread-1.dll" build | |
cd build | |
del /f /s /q .ninja_deps .ninja_log .qt build.ninja CMakeCache.txt cmake_install.cmake compile_commands.json D3Dcompiler_47.dll CMakeFiles imageformats translations framelesshelper qwindowkit | |
rmdir /s /q CMakeFiles imageformats translations .qt framelesshelper qwindowkit | |
- name: Tar build | |
shell: cmd | |
run: | | |
"C:\Windows\System32\tar.exe" -acf ${{ env.PROJECT }}-Windows.zip -C build * | |
- name: Install NSIS | |
uses: repolevedavaj/install-nsis@v1.0.0 | |
with: | |
nsis-version: 3.08 | |
- name: Create installer | |
uses: joncloud/makensis-action@v4 | |
with: | |
arguments: "/V3" | |
script-file: "installer/installer.nsi" | |
- name: Archive Windows binaries | |
uses: actions/upload-artifact@v3 | |
with: | |
name: windows-binaries | |
path: "${{ env.PROJECT }}-Windows.zip" | |
- name: Archive Windows installer | |
uses: actions/upload-artifact@v3 | |
with: | |
name: windows-installer | |
path: "installer/${{ env.PROJECT }}-Installer.exe" | |
build-linux: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install GTK | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libgtk-3-dev libgtk-4-dev | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Install Qt | |
uses: jurplel/install-qt-action@v4 | |
with: | |
version: '${{ env.QT_VERSION }}' | |
host: 'linux' | |
target: 'desktop' | |
arch: 'gcc_64' | |
dir: '${{ github.workspace }}/' | |
install-deps: 'true' | |
cache: 'true' | |
cache-key-prefix: 'install-qt-action' | |
setup-python: 'true' | |
tools: 'tools_cmake tools_ninja' | |
set-env: 'true' | |
tools-only: 'false' | |
aqtversion: '==3.1.*' | |
py7zrversion: '==0.20.*' | |
extra: '--external 7z' | |
- name: Build | |
shell: sh | |
run: | | |
dir | |
mkdir build | |
cd build | |
cmake -DCMAKE_BUILD_TYPE=Release .. | |
cmake --build . | |
- name: Tar build | |
shell: sh | |
run: | | |
tar -czvf ${{ env.PROJECT }}-Linux.tar.gz -C build . | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: linux-binaries | |
path: ${{ env.PROJECT }}-Linux.tar.gz | |
release: | |
needs: [build-windows, build-linux] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download Windows binaries | |
uses: actions/download-artifact@v4.1.7 | |
with: | |
name: windows-binaries | |
path: release | |
- name: Download Windows installer | |
uses: actions/download-artifact@v4.1.7 | |
with: | |
name: windows-installer | |
path: release | |
- name: Download Linux binaries | |
uses: actions/download-artifact@v4.1.7 | |
with: | |
name: linux-binaries | |
path: release | |
- uses: "marvinpinto/action-automatic-releases@latest" | |
with: | |
repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
automatic_release_tag: "latest" | |
prerelease: true | |
title: "Development Build" | |
files: | | |
release/* | |
- uses: geekyeggo/delete-artifact@v2 | |
with: | |
name: | | |
windows-binaries | |
windows-installer | |
linux-binaries | |
failOnError: false |