mirror of
https://github.com/barry-ran/QtScrcpy.git
synced 2025-08-03 14:18:45 +00:00
commit
4a890a43cc
10 changed files with 137 additions and 259 deletions
154
.github/workflows/macos.yml
vendored
154
.github/workflows/macos.yml
vendored
|
@ -13,133 +13,65 @@ on:
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: Build
|
name: Build
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: macos-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-latest]
|
qt-ver: [5.12.6]
|
||||||
qt_ver: [5.12.6]
|
qt-arch-install: [clang_64]
|
||||||
qt_arch: [clang_64]
|
clang-arch: [x64]
|
||||||
env:
|
env:
|
||||||
targetName: QtScrcpy
|
target-name: QtScrcpy
|
||||||
|
qt-install-path: ${{ github.workspace }}/${{ matrix.qt-ver }}
|
||||||
|
plantform-des: mac
|
||||||
steps:
|
steps:
|
||||||
- name: Cache Qt
|
- name: Cache Qt
|
||||||
id: MacosCacheQt
|
id: cache-qt
|
||||||
uses: actions/cache@v1
|
uses: actions/cache@v1
|
||||||
with:
|
with:
|
||||||
path: ../Qt/${{matrix.qt_ver}}/${{matrix.qt_arch}}
|
path: ${{ env.qt-install-path }}/${{ matrix.qt-arch-install }}
|
||||||
key: ${{ runner.os }}-Qt/${{matrix.qt_ver}}/${{matrix.qt_arch}}
|
key: ${{ runner.os }}/${{ matrix.qt-ver }}/${{ matrix.qt-arch-install }}
|
||||||
- name: Setup Qt
|
|
||||||
if: steps.MacosCacheQt.outputs.cache-hit == 'true'
|
|
||||||
shell: pwsh
|
|
||||||
env:
|
|
||||||
QtPath: ../Qt/${{matrix.qt_ver}}/${{matrix.qt_arch}}
|
|
||||||
run: |
|
|
||||||
$qt_Path=${env:QtPath}
|
|
||||||
echo "::set-env name=Qt5_Dir::$qt_Path"
|
|
||||||
echo "::add-path::$qt_Path/bin"
|
|
||||||
- name: Install Qt
|
- name: Install Qt
|
||||||
if: steps.MacosCacheQt.outputs.cache-hit != 'true'
|
|
||||||
uses: jurplel/install-qt-action@v2.0.0
|
uses: jurplel/install-qt-action@v2.0.0
|
||||||
with:
|
with:
|
||||||
version: ${{ matrix.qt_ver }}
|
version: ${{ matrix.qt-ver }}
|
||||||
|
cached: ${{ steps.cache-qt.outputs.cache-hit }}
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
with:
|
with:
|
||||||
fetch-depth: 1
|
fetch-depth: 1
|
||||||
# 编译
|
# 编译
|
||||||
- name: Build MacOS
|
- name: Build MacOS
|
||||||
|
env:
|
||||||
|
ENV_QT_PATH: ${{ env.qt-install-path }}
|
||||||
|
run: ci/mac/build_for_mac.sh release
|
||||||
|
# 获取ref最后一个/后的内容
|
||||||
|
- name: Get the version
|
||||||
|
shell: bash
|
||||||
|
id: get-version
|
||||||
|
# ${ GITHUB_REF/refs\/tags\// }是linux shell ${}的变量替换语法
|
||||||
|
run: echo ::set-output name=version::${GITHUB_REF##*/}
|
||||||
|
# 打包
|
||||||
|
- name: Package
|
||||||
|
id: package
|
||||||
|
env:
|
||||||
|
ENV_QT_PATH: ${{ env.qt-install-path }}
|
||||||
|
publish_name: ${{ env.target-name }}-${{ env.plantform-des }}-${{ matrix.clang-arch }}-${{ steps.get-version.outputs.version }}
|
||||||
run: |
|
run: |
|
||||||
export ENV_QT_CLANG=$(pwd)/${{env.Qt5_Dir}}
|
|
||||||
ci/mac/build_for_mac.sh release
|
|
||||||
# 发布
|
|
||||||
- name: Publish
|
|
||||||
if: startsWith(github.event.ref, 'refs/tags/')
|
|
||||||
run: |
|
|
||||||
export ENV_QT_CLANG=$(pwd)/${{env.Qt5_Dir}}
|
|
||||||
ci/mac/publish_for_mac.sh ../build
|
ci/mac/publish_for_mac.sh ../build
|
||||||
ci/mac/package_for_mac.sh
|
ci/mac/package_for_mac.sh
|
||||||
# tag 打包
|
mv ci/build/QtScrcpy.app ci/build/${{ env.publish_name }}.app
|
||||||
- name: Package
|
mv ci/build/QtScrcpy.dmg ci/build/${{ env.publish_name }}.dmg
|
||||||
if: startsWith(github.event.ref, 'refs/tags/')
|
echo "::set-output name=package-name::${{ env.publish_name }}"
|
||||||
shell: pwsh
|
- uses: actions/upload-artifact@v1
|
||||||
env:
|
|
||||||
ref: ${{ github.event.ref }}
|
|
||||||
run: |
|
|
||||||
[string]$tag = ${env:ref}.Substring(${env:ref}.LastIndexOf('/') + 1)
|
|
||||||
[string]$name = 'QtScrcpy-mac-x64-' + ${tag}
|
|
||||||
# 打包zip
|
|
||||||
Compress-Archive -Path ci\build\QtScrcpy.dmg ci\build\${name}.zip
|
|
||||||
# 查询Release
|
|
||||||
- name: Query Release
|
|
||||||
if: startsWith(github.event.ref, 'refs/tags/')
|
|
||||||
shell: pwsh
|
|
||||||
env:
|
|
||||||
githubFullName: ${{ github.event.repository.full_name }}
|
|
||||||
ref: ${{ github.event.ref }}
|
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
run: |
|
|
||||||
[string]$tag = ${env:ref}.Substring(${env:ref}.LastIndexOf('/') + 1)
|
|
||||||
[string]$url = 'https://api.github.com/repos/' + ${env:githubFullName} + '/releases/tags/' + ${tag}
|
|
||||||
|
|
||||||
$token = ${env:github_token}
|
|
||||||
$authInfo = ("{0}" -f $token)
|
|
||||||
$authInfo = [System.Text.Encoding]::UTF8.GetBytes($authInfo)
|
|
||||||
$authInfo = [System.Convert]::ToBase64String($authInfo)
|
|
||||||
$headers = @{Authorization=("barry-ran {0}" -f $authInfo)}
|
|
||||||
|
|
||||||
$response={}
|
|
||||||
try {
|
|
||||||
$response = Invoke-RestMethod -Uri $url -Headers $headers -Method Get
|
|
||||||
} catch {
|
|
||||||
Write-Host "StatusCode:" $_.Exception.Response.StatusCode.value__
|
|
||||||
Write-Host "StatusDescription:" $_.Exception.Response.StatusDescription
|
|
||||||
# 没查到
|
|
||||||
return 1
|
|
||||||
}
|
|
||||||
[string]$latestUpUrl = $response.upload_url
|
|
||||||
Write-Host 'latestUpUrl:'$latestUpUrl
|
|
||||||
if ($latestUpUrl.Length -eq 0) {
|
|
||||||
# 没查到
|
|
||||||
return 1
|
|
||||||
}
|
|
||||||
# 获取上传url
|
|
||||||
- name: Get Release Url
|
|
||||||
if: startsWith(github.event.ref, 'refs/tags/')
|
|
||||||
shell: pwsh
|
|
||||||
env:
|
|
||||||
githubFullName: ${{ github.event.repository.full_name }}
|
|
||||||
ref: ${{ github.event.ref }}
|
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
run: |
|
|
||||||
[string]$tag = ${env:ref}.Substring(${env:ref}.LastIndexOf('/') + 1)
|
|
||||||
[string]$url = 'https://api.github.com/repos/' + ${env:githubFullName} + '/releases/tags/' + ${tag}
|
|
||||||
|
|
||||||
# github token防止api rate limite,否则一个小时只能60个api请求
|
|
||||||
$token = ${env:github_token}
|
|
||||||
$authInfo = ("{0}" -f $token)
|
|
||||||
$authInfo = [System.Text.Encoding]::UTF8.GetBytes($authInfo)
|
|
||||||
$authInfo = [System.Convert]::ToBase64String($authInfo)
|
|
||||||
$headers = @{Authorization=("barry-ran {0}" -f $authInfo)}
|
|
||||||
|
|
||||||
$response = Invoke-RestMethod -Uri $url -ContentType 'text/json' -Headers $headers -Method Get
|
|
||||||
[string]$latestUpUrl = $response.upload_url
|
|
||||||
Write-Host 'latestUpUrl:'$latestUpUrl
|
|
||||||
echo "::set-env name=uploadUrl::$latestUpUrl"
|
|
||||||
Write-Host 'env uploadUrl:'${env:uploadUrl}
|
|
||||||
[string]$name = 'QtScrcpy-mac-x64-' + ${tag}
|
|
||||||
# 记录环境变量packageName给后续step
|
|
||||||
echo "::set-env name=packageName::$name"
|
|
||||||
# 打印环境变量packageName
|
|
||||||
Write-Host 'packageName:'${env:packageName}
|
|
||||||
# tag 上传Release
|
|
||||||
- name: Upload Release
|
|
||||||
id: uploadRelease
|
|
||||||
if: startsWith(github.event.ref, 'refs/tags/')
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
uses: actions/upload-release-asset@v1.0.1
|
|
||||||
with:
|
with:
|
||||||
upload_url: ${{ env.uploadUrl }}
|
name: ${{ steps.package.outputs.package-name }}.zip
|
||||||
asset_path: ci/build/${{ env.packageName }}.zip
|
path: ci/build/${{ steps.package.outputs.package-name }}.app
|
||||||
asset_name: ${{ env.packageName }}.zip
|
# Upload to release
|
||||||
asset_content_type: application/zip
|
- name: Upload Release
|
||||||
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
|
uses: svenstaro/upload-release-action@v1-release
|
||||||
|
with:
|
||||||
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
file: ci/build/${{ steps.package.outputs.package-name }}.dmg
|
||||||
|
asset_name: ${{ steps.package.outputs.package-name }}.dmg
|
||||||
|
tag: ${{ github.ref }}
|
||||||
|
overwrite: true
|
34
.github/workflows/ubuntu.yml
vendored
34
.github/workflows/ubuntu.yml
vendored
|
@ -18,35 +18,31 @@ jobs:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-16.04,ubuntu-18.04]
|
os: [ubuntu-16.04,ubuntu-18.04]
|
||||||
qt_ver: [5.12.6]
|
qt-ver: [5.12.6]
|
||||||
qt_arch: [gcc_64]
|
qt-arch-install: [gcc_64]
|
||||||
|
gcc-arch: [x64]
|
||||||
|
env:
|
||||||
|
target-name: QtScrcpy
|
||||||
|
qt-install-path: ${{ github.workspace }}/${{ matrix.qt-ver }}
|
||||||
|
plantform-des: ubuntu
|
||||||
steps:
|
steps:
|
||||||
- name: Cache Qt
|
- name: Cache Qt
|
||||||
id: UbuntuCacheQt
|
id: cache-qt
|
||||||
uses: actions/cache@v1
|
uses: actions/cache@v1
|
||||||
with:
|
with:
|
||||||
path: ../Qt/${{matrix.qt_ver}}/${{matrix.qt_arch}}
|
path: ${{ env.qt-install-path }}/${{ matrix.qt-arch-install }}
|
||||||
key: ${{ runner.os }}-Qt/${{matrix.qt_ver}}/${{matrix.qt_arch}}
|
key: ${{ runner.os }}/${{ matrix.qt-ver }}/${{ matrix.qt-arch-install }}
|
||||||
- name: Setup Qt
|
|
||||||
if: steps.UbuntuCacheQt.outputs.cache-hit == 'true'
|
|
||||||
shell: pwsh
|
|
||||||
env:
|
|
||||||
QtPath: ../Qt/${{matrix.qt_ver}}/${{matrix.qt_arch}}
|
|
||||||
run: |
|
|
||||||
$qt_Path=${env:QtPath}
|
|
||||||
echo "::set-env name=Qt5_Dir::$qt_Path"
|
|
||||||
echo "::add-path::$qt_Path/bin"
|
|
||||||
- name: Install Qt
|
- name: Install Qt
|
||||||
if: steps.UbuntuCacheQt.outputs.cache-hit != 'true'
|
|
||||||
uses: jurplel/install-qt-action@v2.0.0
|
uses: jurplel/install-qt-action@v2.0.0
|
||||||
with:
|
with:
|
||||||
version: ${{ matrix.qt_ver }}
|
version: ${{ matrix.qt-ver }}
|
||||||
|
cached: ${{ steps.cache-qt.outputs.cache-hit }}
|
||||||
- name: Ubuntu install GL library
|
- name: Ubuntu install GL library
|
||||||
run: sudo apt-get install -y libglew-dev libglfw3-dev
|
run: sudo apt-get install -y libglew-dev libglfw3-dev
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
with:
|
with:
|
||||||
fetch-depth: 1
|
fetch-depth: 1
|
||||||
- name: Build Ubuntu
|
- name: Build Ubuntu
|
||||||
run: |
|
env:
|
||||||
export ENV_QT_GCC=$(pwd)/${{env.Qt5_Dir}}
|
ENV_QT_PATH: ${{ env.qt-install-path }}
|
||||||
ci/linux/build_for_ubuntu.sh release
|
run: ci/linux/build_for_ubuntu.sh release
|
||||||
|
|
176
.github/workflows/windows.yml
vendored
176
.github/workflows/windows.yml
vendored
|
@ -1,12 +1,11 @@
|
||||||
name: Windows
|
name: Windows
|
||||||
|
# 触发规则详解 https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#on
|
||||||
on:
|
on:
|
||||||
# push代码时触发workflow
|
|
||||||
push:
|
push:
|
||||||
paths:
|
paths:
|
||||||
- 'QtScrcpy/**'
|
- 'QtScrcpy/**'
|
||||||
- '!QtScrcpy/res/**'
|
- '!QtScrcpy/res/**'
|
||||||
- '.github/workflows/windows.yml'
|
- '.github/workflows/windows.yml'
|
||||||
# pull_request时触发workflow
|
|
||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
paths:
|
||||||
- 'QtScrcpy/**'
|
- 'QtScrcpy/**'
|
||||||
|
@ -15,151 +14,94 @@ on:
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: Build
|
name: Build
|
||||||
# 运行平台, windows-latest目前是windows server 2019,选择2016是2016安装的是vs2017
|
# windows-latest目前是windows server 2019,选择2016是2016安装的是vs2017
|
||||||
# https://github.com/actions/virtual-environments/blob/master/images/win/Windows2019-Readme.md
|
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on
|
||||||
# https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners
|
|
||||||
runs-on: windows-2016
|
runs-on: windows-2016
|
||||||
|
|
||||||
|
# 矩阵配置 https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstrategymatrix
|
||||||
strategy:
|
strategy:
|
||||||
# 矩阵配置
|
|
||||||
matrix:
|
matrix:
|
||||||
qt_ver: [5.12.6]
|
qt-ver: [5.12.6]
|
||||||
qt_target: [desktop]
|
qt-arch: [win64_msvc2017_64, win32_msvc2017]
|
||||||
# mingw用不了
|
# 配置qt-arch的额外设置msvc-arch,qt-arch-install
|
||||||
# qt_arch: [win64_msvc2017_64, win32_msvc2017, win32_mingw53,win32_mingw73]
|
|
||||||
qt_arch: [win64_msvc2017_64, win32_msvc2017]
|
|
||||||
# 额外设置msvc_arch
|
|
||||||
include:
|
include:
|
||||||
- qt_arch: win64_msvc2017_64
|
- qt-arch: win64_msvc2017_64
|
||||||
msvc_arch: x64
|
msvc-arch: x64
|
||||||
qt_arch_install: msvc2017_64
|
qt-arch-install: msvc2017_64
|
||||||
- qt_arch: win32_msvc2017
|
- qt-arch: win32_msvc2017
|
||||||
msvc_arch: x86
|
msvc-arch: x86
|
||||||
qt_arch_install: msvc2017
|
qt-arch-install: msvc2017
|
||||||
|
# job env,所有steps都可以访问
|
||||||
|
# 不同级别env详解 https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#env
|
||||||
|
# 使用表达式语法${{}}访问上下文 https://help.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions
|
||||||
env:
|
env:
|
||||||
targetName: QtScrcpy.exe
|
target-name: QtScrcpy
|
||||||
|
vcvarsall-path: 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvarsall.bat'
|
||||||
|
qt-install-path: ${{ github.workspace }}/${{ matrix.qt-ver }}
|
||||||
|
plantform-des: win
|
||||||
# 步骤
|
# 步骤
|
||||||
steps:
|
steps:
|
||||||
- name: Cache Qt
|
- name: Cache Qt
|
||||||
id: WindowsCacheQt
|
id: cache-qt
|
||||||
uses: actions/cache@v1
|
uses: actions/cache@v1
|
||||||
with:
|
with:
|
||||||
path: ../../Qt5/${{matrix.qt_ver}}/${{matrix.qt_arch_install}}
|
path: ${{ env.qt-install-path }}/${{ matrix.qt-arch-install }}
|
||||||
key: ${{ runner.os }}-Qt5.12.6/${{matrix.qt_ver}}/${{matrix.qt_arch}}
|
key: ${{ runner.os }}/${{ matrix.qt-ver }}/${{ matrix.qt-arch }}
|
||||||
- name: Setup Qt
|
|
||||||
if: steps.WindowsCacheQt.outputs.cache-hit == 'true'
|
|
||||||
shell: pwsh
|
|
||||||
env:
|
|
||||||
QtPath: ../../Qt5/${{matrix.qt_ver}}/${{matrix.qt_arch_install}}
|
|
||||||
run: |
|
|
||||||
$qt_Path=${env:QtPath}
|
|
||||||
echo "::set-env name=Qt5_Dir::$qt_Path"
|
|
||||||
echo "::add-path::$qt_Path/bin"
|
|
||||||
# 安装Qt
|
# 安装Qt
|
||||||
- name: Install Qt
|
- name: Install Qt
|
||||||
if: steps.WindowsCacheQt.outputs.cache-hit != 'true'
|
|
||||||
# 使用外部action。这个action专门用来安装Qt
|
# 使用外部action。这个action专门用来安装Qt
|
||||||
uses: jurplel/install-qt-action@v2.0.0
|
uses: jurplel/install-qt-action@v2.0.0
|
||||||
with:
|
with:
|
||||||
# Version of Qt to install
|
# Version of Qt to install
|
||||||
version: ${{ matrix.qt_ver }}
|
version: ${{ matrix.qt-ver }}
|
||||||
# Target platform for build
|
# Target platform for build
|
||||||
target: ${{ matrix.qt_target }}
|
target: desktop
|
||||||
# Architecture for Windows/Android
|
# Architecture for Windows/Android
|
||||||
arch: ${{ matrix.qt_arch }}
|
arch: ${{ matrix.qt-arch }}
|
||||||
|
cached: ${{ steps.cache-qt.outputs.cache-hit }}
|
||||||
# 拉取代码
|
# 拉取代码
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
with:
|
with:
|
||||||
fetch-depth: 1
|
fetch-depth: 1
|
||||||
# 编译msvc
|
# 编译msvc
|
||||||
- name: Build MSVC
|
- name: Build MSVC
|
||||||
|
# shell介绍 https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#using-a-specific-shell
|
||||||
shell: cmd
|
shell: cmd
|
||||||
env:
|
env:
|
||||||
ENV_VCVARSALL: 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvarsall.bat'
|
ENV_VCVARSALL: ${{ env.vcvarsall-path }}
|
||||||
ENV_QT_PATH: 'd:\a\Qt5\5.12.6'
|
ENV_QT_PATH: ${{ env.qt-install-path }}
|
||||||
run: |
|
run: |
|
||||||
call "ci\win\build_for_win.bat" release ${{ matrix.msvc_arch }}
|
call "ci\win\build_for_win.bat" release ${{ matrix.msvc-arch }}
|
||||||
|
# 获取ref最后一个/后的内容
|
||||||
|
- name: Get the version
|
||||||
|
shell: bash
|
||||||
|
id: get-version
|
||||||
|
# ${ GITHUB_REF/refs\/tags\// }是linux shell ${}的变量替换语法
|
||||||
|
run: echo ::set-output name=version::${GITHUB_REF##*/}
|
||||||
# tag 打包
|
# tag 打包
|
||||||
- name: Package
|
- name: Package
|
||||||
if: startsWith(github.event.ref, 'refs/tags/')
|
id: package
|
||||||
env:
|
env:
|
||||||
publish_dir: QtScrcpy-win-${{matrix.msvc_arch}}
|
ENV_QT_PATH: ${{ env.qt-install-path }}
|
||||||
ref: ${{ github.event.ref }}
|
publish_name: ${{ env.target-name }}-${{ env.plantform-des }}-${{ matrix.msvc-arch }}-${{ steps.get-version.outputs.version }}
|
||||||
shell: pwsh
|
|
||||||
run: |
|
run: |
|
||||||
[string]$tag = ${env:ref}.Substring(${env:ref}.LastIndexOf('/') + 1)
|
cmd.exe /c ci\win\publish_for_win.bat ${{ matrix.msvc-arch }} ..\build\${{ env.publish_name }}
|
||||||
[string]$full_publish_dir = ${env:publish_dir} + '-' + ${tag}
|
|
||||||
cmd.exe /c ci\win\publish_for_win.bat ${{matrix.msvc_arch}} ..\build\$full_publish_dir
|
|
||||||
# 打包zip
|
# 打包zip
|
||||||
Compress-Archive -Path ci\build\$full_publish_dir ci\build\${full_publish_dir}.zip
|
Compress-Archive -Path ci\build\${{ env.publish_name }} ci\build\${{ env.publish_name }}.zip
|
||||||
# 记录环境变量packageName给后续step
|
echo "::set-output name=package-name::${{ env.publish_name }}"
|
||||||
$name = $full_publish_dir
|
# 上传artifacts
|
||||||
echo "::set-env name=packageName::$name"
|
# https://help.github.com/en/actions/configuring-and-managing-workflows/persisting-workflow-data-using-artifacts
|
||||||
# 打印环境变量packageName
|
- uses: actions/upload-artifact@v1
|
||||||
Write-Host 'packageName:'${env:packageName}
|
|
||||||
# 查询Release
|
|
||||||
- name: Query Release
|
|
||||||
if: startsWith(github.event.ref, 'refs/tags/')
|
|
||||||
shell: pwsh
|
|
||||||
env:
|
|
||||||
githubFullName: ${{ github.event.repository.full_name }}
|
|
||||||
ref: ${{ github.event.ref }}
|
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
run: |
|
|
||||||
[string]$tag = ${env:ref}.Substring(${env:ref}.LastIndexOf('/') + 1)
|
|
||||||
[string]$url = 'https://api.github.com/repos/' + ${env:githubFullName} + '/releases/tags/' + ${tag}
|
|
||||||
|
|
||||||
$token = ${env:github_token}
|
|
||||||
$authInfo = ("{0}" -f $token)
|
|
||||||
$authInfo = [System.Text.Encoding]::UTF8.GetBytes($authInfo)
|
|
||||||
$authInfo = [System.Convert]::ToBase64String($authInfo)
|
|
||||||
$headers = @{Authorization=("barry-ran {0}" -f $authInfo)}
|
|
||||||
|
|
||||||
$response={}
|
|
||||||
try {
|
|
||||||
$response = Invoke-RestMethod -Uri $url -Headers $headers -Method Get
|
|
||||||
} catch {
|
|
||||||
Write-Host "StatusCode:" $_.Exception.Response.StatusCode.value__
|
|
||||||
Write-Host "StatusDescription:" $_.Exception.Response.StatusDescription
|
|
||||||
# 没查到
|
|
||||||
return 1
|
|
||||||
}
|
|
||||||
[string]$latestUpUrl = $response.upload_url
|
|
||||||
Write-Host 'latestUpUrl:'$latestUpUrl
|
|
||||||
if ($latestUpUrl.Length -eq 0) {
|
|
||||||
# 没查到
|
|
||||||
return 1
|
|
||||||
}
|
|
||||||
# 获取上传url
|
|
||||||
- name: Get Release Url
|
|
||||||
if: startsWith(github.event.ref, 'refs/tags/')
|
|
||||||
shell: pwsh
|
|
||||||
env:
|
|
||||||
githubFullName: ${{ github.event.repository.full_name }}
|
|
||||||
ref: ${{ github.event.ref }}
|
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
run: |
|
|
||||||
[string]$tag = ${env:ref}.Substring(${env:ref}.LastIndexOf('/') + 1)
|
|
||||||
[string]$url = 'https://api.github.com/repos/' + ${env:githubFullName} + '/releases/tags/' + ${tag}
|
|
||||||
# github token防止api rate limite,否则一个小时只能60个api请求
|
|
||||||
$token = ${env:github_token}
|
|
||||||
$authInfo = ("{0}" -f $token)
|
|
||||||
$authInfo = [System.Text.Encoding]::UTF8.GetBytes($authInfo)
|
|
||||||
$authInfo = [System.Convert]::ToBase64String($authInfo)
|
|
||||||
$headers = @{Authorization=("barry-ran {0}" -f $authInfo)}
|
|
||||||
$response = Invoke-RestMethod -Uri $url -ContentType 'text/json' -Headers $headers -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: Upload Release
|
|
||||||
id: uploadRelease
|
|
||||||
if: startsWith(github.event.ref, 'refs/tags/')
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
uses: actions/upload-release-asset@v1.0.1
|
|
||||||
with:
|
with:
|
||||||
upload_url: ${{ env.uploadUrl }}
|
name: ${{ steps.package.outputs.package-name }}.zip
|
||||||
asset_path: ci\build\${{ env.packageName }}.zip
|
path: ci\build\${{ steps.package.outputs.package-name }}
|
||||||
asset_name: ${{ env.packageName }}.zip
|
# Upload to release
|
||||||
asset_content_type: application/zip
|
- name: Upload Release
|
||||||
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
|
uses: svenstaro/upload-release-action@v1-release
|
||||||
|
with:
|
||||||
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
file: ci\build\${{ steps.package.outputs.package-name }}.zip
|
||||||
|
asset_name: ${{ steps.package.outputs.package-name }}.zip
|
||||||
|
tag: ${{ github.ref }}
|
||||||
|
overwrite: true
|
|
@ -59,7 +59,7 @@ INCLUDEPATH += \
|
||||||
# 统一版本号入口,只修改这一个地方即可
|
# 统一版本号入口,只修改这一个地方即可
|
||||||
VERSION_MAJOR = 1
|
VERSION_MAJOR = 1
|
||||||
VERSION_MINOR = 3
|
VERSION_MINOR = 3
|
||||||
VERSION_PATCH = 1
|
VERSION_PATCH = 0
|
||||||
|
|
||||||
# qmake变量的方式定义版本号
|
# qmake变量的方式定义版本号
|
||||||
VERSION = $${VERSION_MAJOR}.$${VERSION_MINOR}.$${VERSION_PATCH}
|
VERSION = $${VERSION_MAJOR}.$${VERSION_MINOR}.$${VERSION_PATCH}
|
||||||
|
|
|
@ -19,13 +19,13 @@
|
||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>APPL</string>
|
<string>APPL</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>1.2.1</string>
|
<string>1.3.0</string>
|
||||||
<key>CFBundleSupportedPlatforms</key>
|
<key>CFBundleSupportedPlatforms</key>
|
||||||
<array>
|
<array>
|
||||||
<string>MacOSX</string>
|
<string>MacOSX</string>
|
||||||
</array>
|
</array>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>1.2.1</string>
|
<string>1.3.0</string>
|
||||||
<key>LSMinimumSystemVersion</key>
|
<key>LSMinimumSystemVersion</key>
|
||||||
<string>10.10</string>
|
<string>10.10</string>
|
||||||
<key>NSAppleEventsUsageDescription</key>
|
<key>NSAppleEventsUsageDescription</key>
|
||||||
|
|
|
@ -6,8 +6,9 @@ echo check ENV
|
||||||
echo ---------------------------------------------------------------
|
echo ---------------------------------------------------------------
|
||||||
|
|
||||||
# 从环境变量获取必要参数
|
# 从环境变量获取必要参数
|
||||||
# 例如 /home/barry/Qt5.9.6/5.9.6/gcc_64
|
# 例如 /home/barry/Qt5.9.6/5.9.6
|
||||||
echo ENV_QT_GCC $ENV_QT_GCC
|
echo ENV_QT_PATH $ENV_QT_PATH
|
||||||
|
qt_gcc_path=$ENV_QT_PATH/gcc_64
|
||||||
|
|
||||||
# 获取绝对路径,保证其他目录执行此脚本依然正确
|
# 获取绝对路径,保证其他目录执行此脚本依然正确
|
||||||
{
|
{
|
||||||
|
@ -39,7 +40,7 @@ fi
|
||||||
echo current build mode: $build_mode
|
echo current build mode: $build_mode
|
||||||
|
|
||||||
# 环境变量设置
|
# 环境变量设置
|
||||||
export PATH=$ENV_QT_GCC/bin:$PATH
|
export PATH=$qt_gcc_path/bin:$PATH
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo
|
echo
|
||||||
|
|
|
@ -6,8 +6,9 @@ echo check ENV
|
||||||
echo ---------------------------------------------------------------
|
echo ---------------------------------------------------------------
|
||||||
|
|
||||||
# 从环境变量获取必要参数
|
# 从环境变量获取必要参数
|
||||||
# 例如 /Users/barry/Qt5.12.5/5.12.5/clang_64
|
# 例如 /Users/barry/Qt5.12.5/5.12.5
|
||||||
echo ENV_QT_CLANG $ENV_QT_CLANG
|
echo ENV_QT_PATH $ENV_QT_PATH
|
||||||
|
qt_clang_path=$ENV_QT_PATH/clang_64
|
||||||
|
|
||||||
# 获取绝对路径,保证其他目录执行此脚本依然正确
|
# 获取绝对路径,保证其他目录执行此脚本依然正确
|
||||||
{
|
{
|
||||||
|
@ -39,7 +40,7 @@ fi
|
||||||
echo current build mode: $build_mode
|
echo current build mode: $build_mode
|
||||||
|
|
||||||
# 环境变量设置
|
# 环境变量设置
|
||||||
export PATH=$ENV_QT_CLANG/bin:$PATH
|
export PATH=$qt_clang_path/bin:$PATH
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo
|
echo
|
||||||
|
|
1
ci/mac/package/dmg-settings.json
Normal file
1
ci/mac/package/dmg-settings.json
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{"icon-size": 120, "format": "UDZO", "title": "QtScrcpy", "compression-level": 9, "window": {"position": {"y": 200, "x": 400}, "size": {"width": 780, "height": 480}}, "background": "/Users/barry/mygitcode/QtScrcpy/ci/mac/package/dmg-background.jpg", "contents": [{"y": 227, "x": 223, "type": "file", "path": "/Users/barry/mygitcode/QtScrcpy/ci/mac/package/../../build/QtScrcpy.app"}, {"y": 227, "x": 550, "type": "link", "path": "/Applications"}]}
|
|
@ -6,7 +6,8 @@ echo ---------------------------------------------------------------
|
||||||
|
|
||||||
# 从环境变量获取必要参数
|
# 从环境变量获取必要参数
|
||||||
# 例如 /Users/barry/Qt5.12.5/5.12.5
|
# 例如 /Users/barry/Qt5.12.5/5.12.5
|
||||||
echo ENV_QT_CLANG $ENV_QT_CLANG
|
echo ENV_QT_PATH $ENV_QT_PATH
|
||||||
|
qt_clang_path=$ENV_QT_PATH/clang_64
|
||||||
|
|
||||||
# 获取绝对路径,保证其他目录执行此脚本依然正确
|
# 获取绝对路径,保证其他目录执行此脚本依然正确
|
||||||
{
|
{
|
||||||
|
@ -31,7 +32,7 @@ keymap_path=$script_path/../../keymap
|
||||||
publish_path=$script_path/$publish_dir
|
publish_path=$script_path/$publish_dir
|
||||||
release_path=$script_path/../../output/mac/release
|
release_path=$script_path/../../output/mac/release
|
||||||
|
|
||||||
export PATH=$ENV_QT_CLANG/bin:$PATH
|
export PATH=$qt_clang_path/bin:$PATH
|
||||||
|
|
||||||
if [ -d "$publish_path" ]; then
|
if [ -d "$publish_path" ]; then
|
||||||
rm -rf $publish_path
|
rm -rf $publish_path
|
||||||
|
|
|
@ -7,13 +7,17 @@
|
||||||
|
|
||||||
## 中优先级
|
## 中优先级
|
||||||
- 脚本
|
- 脚本
|
||||||
- 软解
|
- 某些机器软解不行
|
||||||
- opengles 3.0 兼容性参考[这里](https://github.com/libretro/glsl-shaders/blob/master/nnedi3/shaders/yuv-to-rgb-2x.glsl)
|
- opengles 3.0 兼容性参考[这里](https://github.com/libretro/glsl-shaders/blob/master/nnedi3/shaders/yuv-to-rgb-2x.glsl)
|
||||||
|
|
||||||
## 高优先级
|
## 高优先级
|
||||||
- linux打包以及版本号
|
- linux打包以及版本号
|
||||||
- 关于
|
- 关于
|
||||||
- 旋转
|
- 旋转
|
||||||
|
- mac版本号模板
|
||||||
|
- tag create release
|
||||||
|
- ubuntu自动打包
|
||||||
|
- 版本号抽离优化
|
||||||
|
|
||||||
# mark
|
# mark
|
||||||
## ffmpeg
|
## ffmpeg
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue