Build #459
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 | |
on: | |
#手动触发 | |
workflow_dispatch: | |
#每天早上,中午,下午触发 | |
schedule: | |
- cron: '0 0,12,18 * * *' | |
#每次push到master分支触发 | |
push: | |
tags: | |
- '*' # Push events to matching refs (exact tag match) | |
jobs: | |
build: | |
runs-on: windows-latest | |
strategy: | |
matrix: | |
build-type: [Debug, Release] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Setup Qt | |
uses: jurplel/install-qt-action@v4 | |
with: | |
version: '6.7.2' | |
host: 'windows' | |
target: 'desktop' | |
arch: 'win64_mingw' | |
tools: 'tools_ninja tools_opensslv3_x64 tools_vcredist,qt.tools.vcredist_msvc2022_x64 tools_mingw1310' | |
cache: true | |
modules: 'qt5compat' | |
- uses: lukka/get-cmake@latest | |
- name: Run CMake | |
run: | | |
#set DCMAKE_PREFIX_PATH to environment variable %QTDIR% | |
cmake -B build -S . -G "MinGW Makefiles" -DCMAKE_PREFIX_PATH=$env:QTDIR -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} | |
cd build | |
ls | |
mingw32-make -j16 | |
#copy libgcc_s_seh-1.dll from QT_ROOT_DIR/bin | |
copy $env:QT_ROOT_DIR\bin\libgcc_s_seh-1.dll . | |
copy $env:QT_ROOT_DIR\bin\libstdc++-6.dll . | |
copy $env:QT_ROOT_DIR\bin\libwinpthread-1.dll . | |
#clean up | |
Remove-Item -Recurse -Force CMakeFiles | |
Remove-Item -Recurse -Force thirdParty | |
Remove-Item -Force CMakeCache.txt | |
Remove-Item -Force cmake_install.cmake | |
Remove-Item -Force Makefile | |
Remove-Item -Recurse -Force QSyncUi_autogen | |
Remove-Item -Recurse -Force .qt | |
cd .. | |
ls | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
path: build/ | |
name: ${{ matrix.build-type }} | |
- name: Use windeployqt | |
run: | | |
windeployqt.exe build/QSyncUi.exe | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
path: build/ | |
name: ${{ matrix.build-type }}-deployed | |
- name: Compress artifacts | |
if: startsWith(github.ref, 'refs/tags/') | |
run: | | |
7z a ${{ matrix.build-type }}.7z build/ | |
- name: Create Release | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: softprops/action-gh-release@v2 | |
with: | |
body_path: ext/${{github.ref_name}}-CHANGELOG | |
- name: Upload Release Asset | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: | | |
${{ matrix.build-type }}.7z | |
- name: Install NSIS | |
run: | | |
iwr -useb get.scoop.sh -outfile 'install.ps1' | |
.\install.ps1 -RunAsAdmin | |
scoop update | |
scoop bucket add extras | |
scoop install nsis | |
- name: Create installer | |
uses: joncloud/makensis-action@v4.1 | |
with: | |
arguments: "/DPRODUCT_VERSION=${{ github.ref_name }}" | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
path: LogiCloud.exe | |
name: ${{ matrix.build-type }}-installer | |
- name: Upload installer | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: | | |
LogiCloud.exe |