mirror of
https://github.com/barry-ran/QtScrcpy.git
synced 2025-09-13 04:52:29 +00:00
1
This commit is contained in:
parent
5e6cde79fc
commit
6627cf4c6b
1 changed files with 13 additions and 36 deletions
49
.github/workflows/windows.yml
vendored
49
.github/workflows/windows.yml
vendored
|
@ -22,7 +22,7 @@ jobs:
|
||||||
strategy:
|
strategy:
|
||||||
# 矩阵配置
|
# 矩阵配置
|
||||||
matrix:
|
matrix:
|
||||||
qt_ver: [5.12.7]
|
qt_ver: [5.12.6]
|
||||||
qt_target: [desktop]
|
qt_target: [desktop]
|
||||||
# mingw用不了
|
# mingw用不了
|
||||||
# qt_arch: [win64_msvc2017_64, win32_msvc2017, win32_mingw53,win32_mingw73]
|
# qt_arch: [win64_msvc2017_64, win32_msvc2017, win32_mingw53,win32_mingw73]
|
||||||
|
@ -43,13 +43,13 @@ jobs:
|
||||||
id: WindowsCacheQt
|
id: WindowsCacheQt
|
||||||
uses: actions/cache@v1
|
uses: actions/cache@v1
|
||||||
with:
|
with:
|
||||||
path: ../../Qt/${{matrix.qt_ver}}/${{matrix.qt_arch_install}}
|
path: ../../Qt5/${{matrix.qt_ver}}/${{matrix.qt_arch_install}}
|
||||||
key: ${{ runner.os }}-cache-Qt/${{matrix.qt_ver}}/${{matrix.qt_arch}}
|
key: ${{ runner.os }}-Qt5.12.6/${{matrix.qt_ver}}/${{matrix.qt_arch}}
|
||||||
- name: Setup Qt
|
- name: Setup Qt
|
||||||
if: steps.WindowsCacheQt.outputs.cache-hit == 'true'
|
if: steps.WindowsCacheQt.outputs.cache-hit == 'true'
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
env:
|
env:
|
||||||
QtPath: ../../Qt/${{matrix.qt_ver}}/${{matrix.qt_arch_install}}
|
QtPath: ../../Qt5/${{matrix.qt_ver}}/${{matrix.qt_arch_install}}
|
||||||
run: |
|
run: |
|
||||||
$qt_Path=${env:QtPath}
|
$qt_Path=${env:QtPath}
|
||||||
echo "::set-env name=Qt5_Dir::$qt_Path"
|
echo "::set-env name=Qt5_Dir::$qt_Path"
|
||||||
|
@ -75,7 +75,7 @@ jobs:
|
||||||
shell: cmd
|
shell: cmd
|
||||||
env:
|
env:
|
||||||
ENV_VCVARSALL: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat'
|
ENV_VCVARSALL: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat'
|
||||||
ENV_QT_MSVC: 'd:\a\Qt\5.12.7'
|
ENV_QT_MSVC: 'd:\a\Qt5\5.12.6'
|
||||||
run: |
|
run: |
|
||||||
call "ci\win\build_for_win.bat" release ${{ matrix.msvc_arch }}
|
call "ci\win\build_for_win.bat" release ${{ matrix.msvc_arch }}
|
||||||
# tag 打包
|
# tag 打包
|
||||||
|
@ -96,9 +96,8 @@ jobs:
|
||||||
echo "::set-env name=packageName::$name"
|
echo "::set-env name=packageName::$name"
|
||||||
# 打印环境变量packageName
|
# 打印环境变量packageName
|
||||||
Write-Host 'packageName:'${env:packageName}
|
Write-Host 'packageName:'${env:packageName}
|
||||||
# tag 查询github-Release
|
# 查询Release
|
||||||
- name: Query Release Win
|
- name: Query Release
|
||||||
id: queryReleaseWin
|
|
||||||
if: startsWith(github.event.ref, 'refs/tags/')
|
if: startsWith(github.event.ref, 'refs/tags/')
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
env:
|
env:
|
||||||
|
@ -113,45 +112,23 @@ jobs:
|
||||||
} catch {
|
} catch {
|
||||||
Write-Host "StatusCode:" $_.Exception.Response.StatusCode.value__
|
Write-Host "StatusCode:" $_.Exception.Response.StatusCode.value__
|
||||||
Write-Host "StatusDescription:" $_.Exception.Response.StatusDescription
|
Write-Host "StatusDescription:" $_.Exception.Response.StatusDescription
|
||||||
# 没查到,输出
|
# 没查到
|
||||||
echo "::set-output name=needCreateRelease::true"
|
return 1
|
||||||
return
|
|
||||||
}
|
}
|
||||||
[string]$latestUpUrl = $response.upload_url
|
[string]$latestUpUrl = $response.upload_url
|
||||||
Write-Host 'latestUpUrl:'$latestUpUrl
|
Write-Host 'latestUpUrl:'$latestUpUrl
|
||||||
if ($latestUpUrl.Length -eq 0) {
|
if ($latestUpUrl.Length -eq 0) {
|
||||||
# 没查到,输出
|
# 没查到
|
||||||
echo "::set-output name=needCreateRelease::true"
|
return 1
|
||||||
}
|
}
|
||||||
# tag 创建github-Release
|
# 获取上传url
|
||||||
- name: Create Release Win
|
- name: Get Release Url
|
||||||
id: createReleaseWin
|
|
||||||
if: startsWith(github.event.ref, 'refs/tags/') && steps.queryReleaseWin.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: Get Latest Tag Release
|
|
||||||
# tag 上一步无论成功还是失败都执行
|
|
||||||
if: startsWith(github.event.ref, 'refs/tags/')
|
if: startsWith(github.event.ref, 'refs/tags/')
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
env:
|
env:
|
||||||
githubFullName: ${{ github.event.repository.full_name }}
|
githubFullName: ${{ github.event.repository.full_name }}
|
||||||
upUrl: ${{ steps.createReleaseWin.outputs.upload_url }}
|
|
||||||
ref: ${{ github.event.ref }}
|
ref: ${{ github.event.ref }}
|
||||||
run: |
|
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]$tag = ${env:ref}.Substring(${env:ref}.LastIndexOf('/') + 1)
|
||||||
[string]$url = 'https://api.github.com/repos/' + ${env:githubFullName} + '/releases/tags/' + ${tag}
|
[string]$url = 'https://api.github.com/repos/' + ${env:githubFullName} + '/releases/tags/' + ${tag}
|
||||||
$response = Invoke-RestMethod -Uri $url -Method Get
|
$response = Invoke-RestMethod -Uri $url -Method Get
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue