Skip to content

Merge branch 'main' of https://github.com/LawPlusThree/QSyncUi #41

Merge branch 'main' of https://github.com/LawPlusThree/QSyncUi

Merge branch 'main' of https://github.com/LawPlusThree/QSyncUi #41

Workflow file for this run

name: Build
on:
push:
branches:
- main
#可以手动触发
workflow_dispatch:
jobs:
build:
runs-on: windows-latest
strategy:
matrix:
build-type: [Debug, Release]
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
- uses: ilammy/msvc-dev-cmd@v1
- name: Setup Qt
uses: jurplel/install-qt-action@v4
with:
version: '6.7.2'
host: 'windows'
target: 'desktop'
arch: 'win64_msvc2019_64'
cache: true
- uses: lukka/get-cmake@latest
- name: Cache AWS SDK
id: cache-aws-sdk-cpp
uses: actions/cache@v3
env:
cache-name: cache-aws-sdk
with:
path: "C:/Program Files (x86)/aws"
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{matrix.build-type}}
- if: ${{ steps.cache-aws-sdk-cpp.outputs.cache-hit != 'true' }}
name: Setup aws-sdk-cpp
run: |
git clone --recurse-submodules https://github.com/aws/aws-sdk-cpp
cd aws-sdk-cpp
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX="C:/Program Files (x86)/aws" -DBUILD_ONLY="s3"
cmake --build . --config=${{matrix.build-type}}
cmake --install . --config=${{matrix.build-type}}
cd ../..
#display the content of the directory
- name: Run CMake
run: |
#set DCMAKE_PREFIX_PATH to environment variable %QTDIR%
cmake -B build -S . -G "Visual Studio 17 2022" -DCMAKE_PREFIX_PATH=$env:QTDIR -DCMAKE_BUILD_TYPE=${{ matrix.build-type }}
cmake --build build --config ${{ matrix.build-type }} --parallel 32
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
path: build/${{ matrix.build-type }}
name: ${{ matrix.build-type }}
- name: Use windeployqt
run: |
windeployqt.exe build/${{ matrix.build-type }}/QSyncUi.exe
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
path: build/${{ matrix.build-type }}
name: ${{ matrix.build-type }}-deployed
- name: Compress artifacts
if: startsWith(github.ref, 'refs/tags/')
run: |
7z a build/${{ matrix.build-type }}.7z build/${{ matrix.build-type }}
- 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: |
build/${{ matrix.build-type }}.7z