2020-12-01 17:55:40 +08:00
|
|
|
# 参考文档 https://docs.github.com/en/free-pro-team@latest/actions/
|
2019-12-07 15:45:19 +08:00
|
|
|
name: Windows
|
|
|
|
on:
|
|
|
|
# push代码时触发workflow
|
|
|
|
push:
|
2020-12-02 09:43:38 +08:00
|
|
|
paths:
|
|
|
|
- '3rdparty/**'
|
|
|
|
- 'examples/**'
|
|
|
|
- 'mkspecs/**'
|
|
|
|
- 'src/**'
|
2020-12-30 01:12:50 +08:00
|
|
|
- 'scripts/windows-*.ps1'
|
2020-12-02 09:43:38 +08:00
|
|
|
- '.qmake.conf'
|
|
|
|
- 'TaoQuick.pro'
|
2023-05-12 22:36:50 +08:00
|
|
|
- '.github/workflows/windows-2019.yml'
|
2019-12-07 15:45:19 +08:00
|
|
|
# pull_request时触发workflow
|
|
|
|
pull_request:
|
2020-12-02 09:43:38 +08:00
|
|
|
paths:
|
|
|
|
- '3rdparty/**'
|
|
|
|
- 'examples/**'
|
|
|
|
- 'mkspecs/**'
|
|
|
|
- 'src/**'
|
2020-12-30 01:12:50 +08:00
|
|
|
- 'scripts/windows-*.ps1'
|
2020-12-02 09:43:38 +08:00
|
|
|
- '.qmake.conf'
|
|
|
|
- 'TaoQuick.pro'
|
2023-05-12 22:36:50 +08:00
|
|
|
- '.github/workflows/windows-2019.yml'
|
2019-12-07 15:45:19 +08:00
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
name: Build
|
2023-05-12 22:36:50 +08:00
|
|
|
# 运行平台
|
2020-12-01 17:55:40 +08:00
|
|
|
# 参考文档 https://github.com/actions/virtual-environments/blob/main/images/win/Windows2019-Readme.md
|
|
|
|
runs-on: windows-2019
|
2019-12-07 15:45:19 +08:00
|
|
|
strategy:
|
|
|
|
# 矩阵配置
|
|
|
|
matrix:
|
|
|
|
include:
|
2020-12-01 17:55:40 +08:00
|
|
|
# 5.9.9 参考 https://mirrors.cloud.tencent.com/qt/online/qtsdkrepository/windows_x86/desktop/qt5_599/
|
|
|
|
- qt_ver: 5.9.9
|
|
|
|
qt_arch: win32_msvc2015
|
|
|
|
msvc_arch: x86
|
|
|
|
qt_arch_install: msvc2015
|
|
|
|
- qt_ver: 5.9.9
|
|
|
|
qt_arch: win64_msvc2017_64
|
2019-12-07 15:45:19 +08:00
|
|
|
msvc_arch: x64
|
|
|
|
qt_arch_install: msvc2017_64
|
2020-12-01 17:55:40 +08:00
|
|
|
# 5.12.10 参考 https://mirrors.cloud.tencent.com/qt/online/qtsdkrepository/windows_x86/desktop/qt5_51210/
|
|
|
|
- qt_ver: 5.12.10
|
|
|
|
qt_arch: win32_msvc2017
|
2019-12-07 15:45:19 +08:00
|
|
|
msvc_arch: x86
|
|
|
|
qt_arch_install: msvc2017
|
2020-12-01 17:55:40 +08:00
|
|
|
- qt_ver: 5.12.10
|
|
|
|
qt_arch: win64_msvc2017_64
|
|
|
|
msvc_arch: x64
|
|
|
|
qt_arch_install: msvc2017_64
|
|
|
|
# 5.15.2 参考 https://mirrors.cloud.tencent.com/qt/online/qtsdkrepository/windows_x86/desktop/qt5_5152/
|
|
|
|
- qt_ver: 5.15.2
|
|
|
|
qt_arch: win32_msvc2019
|
|
|
|
msvc_arch: x86
|
|
|
|
qt_arch_install: msvc2019
|
|
|
|
- qt_ver: 5.15.2
|
|
|
|
qt_arch: win64_msvc2019_64
|
|
|
|
msvc_arch: x64
|
|
|
|
qt_arch_install: msvc2019_64
|
2019-12-07 15:45:19 +08:00
|
|
|
env:
|
2020-10-21 20:12:56 +08:00
|
|
|
targetName: TaoQuickShow.exe
|
2019-12-07 15:45:19 +08:00
|
|
|
# 步骤
|
|
|
|
steps:
|
|
|
|
# 安装Qt
|
|
|
|
- name: Install Qt
|
|
|
|
# 使用外部action。这个action专门用来安装Qt
|
2022-01-11 15:07:25 +08:00
|
|
|
uses: jurplel/install-qt-action@v2
|
2019-12-07 15:45:19 +08:00
|
|
|
with:
|
|
|
|
# Version of Qt to install
|
|
|
|
version: ${{ matrix.qt_ver }}
|
|
|
|
# Target platform for build
|
2020-12-01 21:14:33 +08:00
|
|
|
# target: ${{ matrix.qt_target }}
|
2019-12-07 15:45:19 +08:00
|
|
|
arch: ${{ matrix.qt_arch }}
|
2020-12-01 17:55:40 +08:00
|
|
|
cached: 'false'
|
2019-12-07 15:45:19 +08:00
|
|
|
# 拉取代码
|
2021-03-01 09:45:19 +08:00
|
|
|
- uses: actions/checkout@v2
|
2019-12-07 15:45:19 +08:00
|
|
|
with:
|
|
|
|
fetch-depth: 1
|
2021-01-25 14:27:03 +08:00
|
|
|
submodules: 'true'
|
2021-01-18 15:06:52 +08:00
|
|
|
# msvc编译
|
|
|
|
- name: msvc-build
|
2020-12-29 23:02:05 +08:00
|
|
|
id: build
|
2019-12-07 15:45:19 +08:00
|
|
|
shell: cmd
|
|
|
|
run: |
|
2020-12-18 13:27:41 +08:00
|
|
|
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.msvc_arch }}
|
2019-12-07 15:45:19 +08:00
|
|
|
qmake
|
|
|
|
nmake
|
2020-12-30 09:31:30 +08:00
|
|
|
echo winSdkDir=%WindowsSdkDir% >> %GITHUB_ENV%
|
|
|
|
echo winSdkVer=%WindowsSdkVersion% >> %GITHUB_ENV%
|
|
|
|
echo vcToolsInstallDir=%VCToolsInstallDir% >> %GITHUB_ENV%
|
|
|
|
echo vcToolsRedistDir=%VCToolsRedistDir% >> %GITHUB_ENV%
|
2019-12-07 15:45:19 +08:00
|
|
|
# tag 打包
|
|
|
|
- name: package
|
2020-12-08 11:20:55 +08:00
|
|
|
id: package
|
2020-12-30 00:06:53 +08:00
|
|
|
# if: startsWith(github.event.ref, 'refs/tags/')
|
2019-12-07 15:45:19 +08:00
|
|
|
env:
|
2020-12-01 21:20:11 +08:00
|
|
|
archiveName: ${{ matrix.qt_ver }}-${{ matrix.qt_arch }}
|
2020-12-29 23:02:05 +08:00
|
|
|
msvcArch: ${{ matrix.msvc_arch }}
|
2019-12-07 15:45:19 +08:00
|
|
|
shell: pwsh
|
|
|
|
run: |
|
2020-12-18 20:19:12 +08:00
|
|
|
& scripts\windows-publish.ps1 ${env:archiveName} ${env:targetName}
|
2020-12-01 17:55:40 +08:00
|
|
|
# 记录packageName给后续step
|
2020-12-18 13:27:41 +08:00
|
|
|
$name = ${env:archiveName}
|
|
|
|
echo "::set-output name=packageName::$name"
|
2020-12-01 17:55:40 +08:00
|
|
|
# 上传artifacts
|
2020-12-18 13:27:41 +08:00
|
|
|
- uses: actions/upload-artifact@v2
|
|
|
|
with:
|
2021-01-15 11:01:19 +08:00
|
|
|
name: ${{ steps.package.outputs.packageName }}
|
2022-01-10 13:05:56 +08:00
|
|
|
path: ${{ steps.package.outputs.packageName }}
|
2019-12-07 15:45:19 +08:00
|
|
|
# tag 上传Release
|
|
|
|
- name: uploadRelease
|
|
|
|
if: startsWith(github.event.ref, 'refs/tags/')
|
2020-12-01 17:55:40 +08:00
|
|
|
uses: svenstaro/upload-release-action@v2
|
2019-12-07 15:45:19 +08:00
|
|
|
with:
|
2020-12-01 17:55:40 +08:00
|
|
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
2022-01-10 13:05:56 +08:00
|
|
|
file: ${{ steps.package.outputs.packageName }}.zip
|
|
|
|
asset_name: ${{ steps.package.outputs.packageName }}.zip
|
2020-12-01 17:55:40 +08:00
|
|
|
tag: ${{ github.ref }}
|
2020-12-18 20:07:26 +08:00
|
|
|
overwrite: true
|