Skip to content

Commit f18b1a6

Browse files
committed
修改 MacOS 下 CI/CD
1 parent 8c42322 commit f18b1a6

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

.github/workflows/macos.yml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@ jobs:
2020
qt_ver: [6.2.2, 6.6.0]
2121
qt_arch: [clang_64]
2222
env:
23-
targetName: PolyChat
2423
# 在 Qt pro 文件中的 TARGET
25-
QtApplicationName: PolyChat
24+
AppTargetName: PolyChat
25+
# .app 所处编译文件夹的路径
26+
QtAppDirName: App
2627
steps:
2728
# macos 11.0 默认环境变了,要指定
2829
- name: prepare env
@@ -61,30 +62,30 @@ jobs:
6162
- name: Build on macOS
6263
run: |
6364
ls
64-
cd ./${QtApplicationName}
65+
cd ./${QtAppDirName}
6566
qmake
6667
make
6768
# 打包
6869
- name: Package on MacOS
6970
run: |
70-
cd ./${QtApplicationName}
71-
# mv ./${QtApplicationName}/${QtApplicationName}.app .
71+
cd ./${QtAppDirName}
72+
# mv ./${QtAppDirName}/${AppTargetName}.app .
7273
echo '------------------'
7374
ls
7475
# 拷贝依赖 pro文件里的名称:
75-
macdeployqt ${QtApplicationName}.app -qmldir=. -verbose=1 -dmg
76+
macdeployqt ${AppTargetName}.app -qmldir=. -verbose=1 -dmg
7677
# 上传artifacts
7778
- uses: actions/upload-artifact@v2
7879
with:
79-
name: ${{ env.targetName }}_${{ matrix.os }}_${{matrix.qt_ver}}.zip
80-
path: ${{ env.QtApplicationName }}/${{ env.QtApplicationName }}.app
80+
name: ${{ env.AppTargetName }}_${{ matrix.os }}_${{matrix.qt_ver}}.zip
81+
path: ${{ env.QtAppDirName }}/${{ env.AppTargetName }}.app
8182
# tag 上传Release
8283
- name: Upload Release
8384
if: startsWith(github.event.ref, 'refs/tags/')
8485
uses: svenstaro/upload-release-action@v2
8586
with:
8687
repo_token: ${{ secrets.GITHUB_TOKEN }}
87-
file: ${{ env.QtApplicationName }}/${{ env.QtApplicationName }}.dmg
88-
asset_name: ${{ env.targetName }}_${{ matrix.os }}_${{ matrix.qt_ver }}.dmg
88+
file: ${{ env.QtAppDirName }}/${{ env.AppTargetName }}.dmg
89+
asset_name: ${{ env.AppTargetName }}_${{ matrix.os }}_${{ matrix.qt_ver }}.dmg
8990
tag: ${{ github.ref }}
9091
overwrite: true

0 commit comments

Comments
 (0)