1
0
mirror of https://github.com/jaredtao/TaoQuick.git synced 2025-01-19 20:22:56 +08:00

update all ci

This commit is contained in:
jared 2020-12-01 18:35:27 +08:00
parent 1822f26a02
commit 49771cea5a
5 changed files with 70 additions and 110 deletions

View File

@ -2,32 +2,37 @@ name: Android
on:
push:
paths-ignore:
- 'README.md'
- 'LICENSE'
- '*.md'
- 'LICENSE'
- "doc/**"
- "preview/**"
# pull_request时触发workflow
pull_request:
paths-ignore:
- 'README.md'
- 'LICENSE'
- 'LICENSE'
- "doc/**"
- "preview/**"
jobs:
build:
name: Build
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
os: [ubuntu-18.04,ubuntu-20.04]
# 5.9.8 版本低,需要额外设置工具链。这里暂不支持。
qt_ver: [5.12.6]
qt_ver: [5.12.10]
qt_target: [android]
qt_arch: [android_x86,android_armv7,android_arm64_v8a]
# android_arm64_v8a 暂时不支持. install-qt-action 依赖的aqtinstall版本为0.5*,需要升级
# qt_arch: [android_x86,android_armv7,android_arm64_v8a]
qt_arch: [android_x86,android_armv7]
# qt_arch: [android_x86,android_armv7]
# exclude:
# - qt_ver: 5.9.8
# qt_arch: android_arm64_v8a
steps:
- name: Install Qt
# if: steps.cacheqt.outputs.cache-hit != 'true'
uses: jurplel/install-qt-action@v2.6.3
uses: jurplel/install-qt-action@v2.10.0
with:
# Version of Qt to install
version: ${{ matrix.qt_ver }}

View File

@ -2,23 +2,30 @@ name: IOS
on:
push:
paths-ignore:
- 'README.md'
- '*.md'
- 'LICENSE'
- "doc/**"
- "preview/**"
# pull_request时触发workflow
pull_request:
paths-ignore:
- 'README.md'
- 'LICENSE'
- "doc/**"
- "preview/**"
jobs:
build:
name: Build
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest]
qt_ver: [5.12.6]
os: [macos-10.15,macos-11.0]
qt_ver: [5.9.9,5.12.10,5.15.2]
qt_target: [ios]
steps:
- name: Install Qt
# if: steps.cacheqt.outputs.cache-hit != 'true'
uses: jurplel/install-qt-action@v2.6.3
uses: jurplel/install-qt-action@v2.10.0
with:
# Version of Qt to install
version: ${{ matrix.qt_ver }}

View File

@ -2,30 +2,35 @@ name: MacOS
on:
push:
paths-ignore:
- 'README.md'
- '*.md'
- 'LICENSE'
- "doc/**"
- "preview/**"
# pull_request时触发workflow
pull_request:
paths-ignore:
- 'README.md'
- 'LICENSE'
- "doc/**"
- "preview/**"
jobs:
build:
name: Build
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest]
qt_ver: [5.12.6]
os: [macos-10.15,macos-11.0]
qt_ver: [5.9.9,5.12.10,5.15.2]
qt_arch: [clang_64]
env:
targetName: TaoQuickShow
steps:
- name: cacheQt
id: MacosCacheQt
uses: actions/cache@v1
with:
path: ../Qt/${{matrix.qt_ver}}/${{matrix.qt_arch}}
key: ${{ runner.os }}-Qt/${{matrix.qt_ver}}/${{matrix.qt_arch}}
# - name: cacheQt
# id: MacosCacheQt
# uses: actions/cache@v1
# with:
# path: ../Qt/${{matrix.qt_ver}}/${{matrix.qt_arch}}
# key: ${{ runner.os }}-Qt/${{matrix.qt_ver}}/${{matrix.qt_arch}}
# - name: setupQt
# if: steps.MacosCacheQt.outputs.cache-hit == 'true'
# shell: pwsh
@ -37,10 +42,11 @@ jobs:
# echo "::add-path::$qt_Path/bin"
- name: Install Qt
# if: steps.MacosCacheQt.outputs.cache-hit != 'true'
uses: jurplel/install-qt-action@v2.6.3
uses: jurplel/install-qt-action@v2.10.0
with:
version: ${{ matrix.qt_ver }}
cached: ${{ steps.MacosCacheQt.outputs.cache-hit }}
# cached: ${{ steps.MacosCacheQt.outputs.cache-hit }}
cached: 'false'
- uses: actions/checkout@v1
with:
@ -55,78 +61,14 @@ jobs:
run: |
# 拷贝依赖
macdeployqt bin/release/${targetName}.app -qmldir=. -verbose=1 -dmg
# tag 查询github-Release
- name: queryRelease
id: queryReleaseMacos
if: startsWith(github.event.ref, 'refs/tags/')
shell: pwsh
env:
githubFullName: ${{ github.event.repository.full_name }}
ref: ${{ github.event.ref }}
run: |
[string]$tag = ${env:ref}.Substring(${env:ref}.LastIndexOf('/') + 1)
[string]$url = 'https://api.github.com/repos/' + ${env:githubFullName} + '/releases/tags/' + ${tag}
$response={}
try {
$response = Invoke-RestMethod -Uri $url -Method Get
} catch {
Write-Host "StatusCode:" $_.Exception.Response.StatusCode.value__
Write-Host "StatusDescription:" $_.Exception.Response.StatusDescription
# 没查到,输出
echo "::set-output name=needCreateRelease::true"
return
}
[string]$latestUpUrl = $response.upload_url
Write-Host 'latestUpUrl:'$latestUpUrl
if ($latestUpUrl.Length -eq 0) {
# 没查到,输出
echo "::set-output name=needCreateRelease::true"
}
# tag 创建github-Release
- name: createReleaseWin
id: createReleaseWin
if: startsWith(github.event.ref, 'refs/tags/') && steps.queryReleaseMacos.outputs.needCreateRelease == 'true'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: actions/create-release@v1.0.0
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: ${{ github.event.head_commit.message }}
draft: false
prerelease: false
# 重定向upload_url到环境变量uploadUrl。
- name: getLatestTagRelease
# tag 上一步无论成功还是失败都执行
if: startsWith(github.event.ref, 'refs/tags/')
shell: pwsh
env:
githubFullName: ${{ github.event.repository.full_name }}
upUrl: ${{ steps.queryReleaseMacos.outputs.upload_url }}
ref: ${{ github.event.ref }}
run: |
# upUrl不为空导出就完事
if (${env:upUrl}.Length -gt 0) {
$v=${env:upUrl}
echo "::set-env name=uploadUrl::$v"
return
}
[string]$tag = ${env:ref}.Substring(${env:ref}.LastIndexOf('/') + 1)
[string]$url = 'https://api.github.com/repos/' + ${env:githubFullName} + '/releases/tags/' + ${tag}
$response = Invoke-RestMethod -Uri $url -Method Get
[string]$latestUpUrl = $response.upload_url
Write-Host 'latestUpUrl:'$latestUpUrl
echo "::set-env name=uploadUrl::$latestUpUrl"
Write-Host 'env uploadUrl:'${env:uploadUrl}
# tag 上传Release
- name: uploadRelease
id: uploadRelease
if: startsWith(github.event.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: actions/upload-release-asset@v1.0.1
uses: svenstaro/upload-release-action@v2
with:
upload_url: ${{ env.uploadUrl }}
asset_path: ./bin/release/${{ env.targetName }}.dmg
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: bin/release/${{ env.targetName }}.dmg
asset_name: ${{ runner.os }}-${{ env.targetName }}.dmg
asset_content_type: application/applefile
tag: ${{ github.ref }}
overwrite: true

View File

@ -1,30 +1,36 @@
name: Ubuntu
# Qt官方没有linux平台的x86包
on:
# push代码时触发workflow
push:
paths-ignore:
- 'README.md'
- '*.md'
- 'LICENSE'
- "doc/**"
- "preview/**"
# pull_request时触发workflow
pull_request:
paths-ignore:
- 'README.md'
- 'LICENSE'
- "doc/**"
- "preview/**"
jobs:
build:
name: Build
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-16.04,ubuntu-18.04]
qt_ver: [5.12.6]
os: [ubuntu-16.04,ubuntu-18.04,ubuntu-20.04]
qt_ver: [5.9.9,5.12.10,5.15.2]
qt_arch: [gcc_64]
steps:
- name: cacheQt
id: UbuntuCacheQt
uses: actions/cache@v1
with:
path: ../Qt/${{matrix.qt_ver}}/${{matrix.qt_arch}}
key: ${{ runner.os }}-Qt/${{matrix.qt_ver}}/${{matrix.qt_arch}}
# - name: cacheQt
# id: UbuntuCacheQt
# uses: actions/cache@v1
# with:
# path: ../Qt/${{matrix.qt_ver}}/${{matrix.qt_arch}}
# key: ${{ runner.os }}-Qt/${{matrix.qt_ver}}/${{matrix.qt_arch}}
# - name: setupQt
# if: steps.UbuntuCacheQt.outputs.cache-hit == 'true'
# shell: pwsh
@ -36,10 +42,11 @@ jobs:
# echo "::add-path::$qt_Path/bin"
- name: Install Qt
# if: steps.UbuntuCacheQt.outputs.cache-hit != 'true'
uses: jurplel/install-qt-action@v2.6.3
uses: jurplel/install-qt-action@v2.10.0
with:
version: ${{ matrix.qt_ver }}
cached: ${{ steps.UbuntuCacheQt.outputs.cache-hit }}
# cached: ${{ steps.UbuntuCacheQt.outputs.cache-hit }}
cached: 'false'
- name: ubuntu install GL library
run: sudo apt-get install -y libglew-dev libglfw3-dev
- uses: actions/checkout@v1

View File

@ -3,7 +3,6 @@ name: Windows
on:
# push代码时触发workflow
push:
# 忽略README.md
paths-ignore:
- '*.md'
- 'LICENSE'
@ -11,7 +10,6 @@ on:
- "preview/**"
# pull_request时触发workflow
pull_request:
# 忽略README.md
paths-ignore:
- 'README.md'
- 'LICENSE'
@ -90,6 +88,7 @@ jobs:
target: ${{ matrix.qt_target }}
# Architecture for Windows/Android
arch: ${{ matrix.qt_arch }}
dir: ${{ github.workspace }}/Qt
# cached: ${{ steps.WindowsCacheQt.outputs.cache-hit }}
cached: 'false'
# 拉取代码
@ -126,10 +125,10 @@ jobs:
$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 }}.zip
# - uses: actions/upload-artifact@v2
# with:
# name: ${{ steps.package.outputs.packageName }}
# path: ${{ steps.package.outputs.packageName }}.zip
# tag 上传Release
- name: uploadRelease
if: startsWith(github.event.ref, 'refs/tags/')