Skip to content

Commit

Permalink
update ci
Browse files Browse the repository at this point in the history
  • Loading branch information
jared2020 committed Dec 18, 2020
1 parent fa91d11 commit 6a5ccd9
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 37 deletions.
30 changes: 15 additions & 15 deletions .github/workflows/macos-11_0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,19 @@ jobs:
qmake
make
# tag 打包
- name: package
if: startsWith(github.event.ref, 'refs/tags/')
run: |
# 拷贝依赖
macdeployqt bin/release/${targetName}.app -qmldir=. -verbose=1 -dmg
# - name: package
# if: startsWith(github.event.ref, 'refs/tags/')
# run: |
# # 拷贝依赖
# macdeployqt bin/release/${targetName}.app -qmldir=. -verbose=1 -dmg

# tag 上传Release
- name: uploadRelease
if: startsWith(github.event.ref, 'refs/tags/')
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: bin/release/${{ env.targetName }}.dmg
asset_name: ${{ env.targetName }}-${{ matrix.os }}-${{ matrix.qt_ver }}.dmg
tag: ${{ github.ref }}
overwrite: true
# # tag 上传Release
# - name: uploadRelease
# if: startsWith(github.event.ref, 'refs/tags/')
# uses: svenstaro/upload-release-action@v2
# with:
# repo_token: ${{ secrets.GITHUB_TOKEN }}
# file: bin/release/${{ env.targetName }}.dmg
# asset_name: ${{ env.targetName }}-${{ matrix.os }}-${{ matrix.qt_ver }}.dmg
# tag: ${{ github.ref }}
# overwrite: true
6 changes: 5 additions & 1 deletion .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ jobs:
run: |
# 拷贝依赖
macdeployqt bin/release/${targetName}.app -qmldir=. -verbose=1 -dmg
# 上传artifacts
- uses: actions/upload-artifact@v2
with:
name: ${targetName}.zip
path: bin/release/${targetName}.app
# tag 上传Release
- name: uploadRelease
if: startsWith(github.event.ref, 'refs/tags/')
Expand Down
30 changes: 9 additions & 21 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ jobs:
qt_arch_install: msvc2019_64
env:
targetName: TaoQuickShow.exe
VCINSTALLDIR: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC'
# 步骤
steps:
# 安装Qt
Expand All @@ -81,10 +82,8 @@ jobs:
# 编译msvc
- name: build-msvc
shell: cmd
env:
vc_arch: ${{ matrix.msvc_arch }}
run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" %vc_arch%
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.msvc_arch }}
qmake
nmake
# tag 打包
Expand All @@ -96,26 +95,15 @@ jobs:
archiveName: ${{ matrix.qt_ver }}-${{ matrix.qt_arch }}
shell: pwsh
run: |
# 创建文件夹
New-Item -ItemType Directory ${env:archiveName}
# 拷贝exe
Copy-Item bin\release\${env:targetName} ${env:archiveName}\
Copy-Item bin\release\Trans ${env:archiveName}\Trans -Recurse
# 拷贝依赖
windeployqt --qmldir . ${env:archiveName}\${env:targetName}
# 删除不必要的库
$excludeList=@("*.qmlc", "*.ilk", "*.exp", "*.lib", "*.pdb")
Remove-Item -Path Qml -Include $excludeList -Recurse -Force
# 打包zip
Compress-Archive -Path ${env:archiveName} ${env:archiveName}'.zip'
& scripts\windows-publish.ps1 ${env.archiveName} ${env.targetName}
# 记录packageName给后续step
$name = ${env:archiveName}
echo "::set-output name=packageName::$name"
$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/')
Expand Down
31 changes: 31 additions & 0 deletions scripts/windows-publish.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
$scriptDir=$PSScriptRoot
$currentDir=Get-Location
Write-Host "currentDir" $currentDir
Write-Host "scriptDir" $scriptDir


function Main() {
if ($args.Length -le 1 ) {
Write-Host "args missing, need at last 2, real " $args.Length
return
}

[string]$archiveName=$args[0]
[string]$targetName=$args[1]

New-Item -ItemType Directory $archiveName
# 拷贝exe
Copy-Item bin\release\$targetName $archiveName\
Copy-Item bin\release\Trans $archiveName\Trans -Recurse
# 拷贝依赖
windeployqt --qmldir . $archiveName\$targetName
# 删除不必要的库
#$excludeList = @("*.qmlc", "*.ilk", "*.exp", "*.lib", "*.pdb")
#Remove-Item -Path Qml -Include $excludeList -Recurse -Force
# 打包zip
Compress-Archive -Path $archiveName $archiveName'.zip'
}

Main $args


0 comments on commit 6a5ccd9

Please sign in to comment.