Skip to content

Commit

Permalink
update actions
Browse files Browse the repository at this point in the history
  • Loading branch information
jared2020 committed May 12, 2023
1 parent 269b548 commit eb863d5
Show file tree
Hide file tree
Showing 5 changed files with 169 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-10.15,macos-11.0]
os: [macos-10.15,macos-11.0,macos-12]
qt_ver: [5.9.9,5.12.10,5.15.2]
qt_arch: [clang_64]
env:
Expand Down
32 changes: 30 additions & 2 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,21 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-18.04,ubuntu-20.04]
os: [ubuntu-18.04,ubuntu-20.04,ubuntu-22.04]
qt_ver: [5.9.9,5.12.10,5.15.2]
qt_arch: [gcc_64]
env:
targetName: TaoQuickShow
steps:
- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
version: ${{ matrix.qt_ver }}
cached: 'false'
- name: Install QT linux deploy
uses: miurahr/install-linuxdeploy-action@v1
with:
plugins: qt appimage
- name: ubuntu install GL library
run: sudo apt-get install -y libglew-dev libglfw3-dev
- uses: actions/checkout@v2
Expand All @@ -45,4 +51,26 @@ jobs:
- name: build ubuntu
run: |
qmake
make
make
- name: package
run: |
# make sure Qt plugin finds QML sources so it can deploy the imported files
export QML_SOURCES_PATHS=./
# 拷贝依赖
linuxdeploy-x86_64.AppImage --plugin=qt --output=appimage --create-desktop-file --icon-file=examples/TaoQuickShow/${targetName}.svg --executable=bin/release/${targetName} --appdir bin/release/
mv ${{ env.targetName }}-*.AppImage ${{ env.targetName }}.AppImage
- uses: actions/upload-artifact@v2
with:
name: ${{ env.targetName }}_${{ matrix.os }}_${{matrix.qt_ver}}
path: ${{ env.targetName }}.AppImage

- name: uploadRelease
if: startsWith(github.event.ref, 'refs/tags/')
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ env.targetName }}.AppImage
asset_name: ${{ env.targetName }}_${{ github.ref_name }}_${{ matrix.os }}_Qt${{ matrix.qt_ver }}.AppImage
tag: ${{ github.ref }}
overwrite: true
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
- 'scripts/windows-*.ps1'
- '.qmake.conf'
- 'TaoQuick.pro'
- '.github/workflows/windows.yml'
- '.github/workflows/windows-2019.yml'
# pull_request时触发workflow
pull_request:
paths:
Expand All @@ -22,11 +22,11 @@ on:
- 'scripts/windows-*.ps1'
- '.qmake.conf'
- 'TaoQuick.pro'
- '.github/workflows/windows.yml'
- '.github/workflows/windows-2019.yml'
jobs:
build:
name: Build
# 运行平台, windows-latest目前是windows server 2019
# 运行平台
# 参考文档 https://github.com/actions/virtual-environments/blob/main/images/win/Windows2019-Readme.md
runs-on: windows-2019
strategy:
Expand Down
104 changes: 104 additions & 0 deletions .github/workflows/windows-2022.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# 参考文档 https://docs.github.com/en/free-pro-team@latest/actions/
name: Windows
on:
# push代码时触发workflow
push:
paths:
- '3rdparty/**'
- 'examples/**'
- 'mkspecs/**'
- 'src/**'
- 'scripts/windows-*.ps1'
- '.qmake.conf'
- 'TaoQuick.pro'
- '.github/workflows/windows-2022.yml'
# pull_request时触发workflow
pull_request:
paths:
- '3rdparty/**'
- 'examples/**'
- 'mkspecs/**'
- 'src/**'
- 'scripts/windows-*.ps1'
- '.qmake.conf'
- 'TaoQuick.pro'
- '.github/workflows/windows-2022.yml'
jobs:
build:
name: Build
# 运行平台
# 参考文档 https://github.com/actions/virtual-environments/blob/main/images/win/Windows2019-Readme.md
runs-on: windows-2022
strategy:
# 矩阵配置
matrix:
include:
# 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
env:
targetName: TaoQuickShow.exe
# 步骤
steps:
# 安装Qt
- name: Install Qt
# 使用外部action。这个action专门用来安装Qt
uses: jurplel/install-qt-action@v2
with:
# Version of Qt to install
version: ${{ matrix.qt_ver }}
# Target platform for build
# target: ${{ matrix.qt_target }}
arch: ${{ matrix.qt_arch }}
cached: 'false'
# 拉取代码
- uses: actions/checkout@v2
with:
fetch-depth: 1
submodules: 'true'
# msvc编译
- name: msvc-build
id: build
shell: cmd
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.msvc_arch }}
qmake
nmake
echo winSdkDir=%WindowsSdkDir% >> %GITHUB_ENV%
echo winSdkVer=%WindowsSdkVersion% >> %GITHUB_ENV%
echo vcToolsInstallDir=%VCToolsInstallDir% >> %GITHUB_ENV%
echo vcToolsRedistDir=%VCToolsRedistDir% >> %GITHUB_ENV%
# tag 打包
- name: package
id: package
# if: startsWith(github.event.ref, 'refs/tags/')
env:
archiveName: ${{ matrix.qt_ver }}-${{ matrix.qt_arch }}
msvcArch: ${{ matrix.msvc_arch }}
shell: pwsh
run: |
& scripts\windows-publish.ps1 ${env:archiveName} ${env:targetName}
# 记录packageName给后续step
$name = ${env:archiveName}
echo "::set-output name=packageName::$name"
# 上传artifacts
- uses: actions/upload-artifact@v2
with:
name: ${{ steps.package.outputs.packageName }}
path: ${{ steps.package.outputs.packageName }}
# tag 上传Release
- name: uploadRelease
if: startsWith(github.event.ref, 'refs/tags/')
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ steps.package.outputs.packageName }}.zip
asset_name: ${{ steps.package.outputs.packageName }}.zip
tag: ${{ github.ref }}
overwrite: true
31 changes: 31 additions & 0 deletions examples/TaoQuickShow/TaoQuickShow.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit eb863d5

Please sign in to comment.