Merge branch 'main' of https://gitee.com/opguess/QSyncUi #84
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: | |
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}} | |
#使用xcopy复制C:\Program Files (x86)\aws\bin下的所有dll到build/${{ 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 | |
xcopy "C:\Program Files (x86)\aws\bin" "build\${{ matrix.build-type }}" /s /y | |
- 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 | |