Skip to content

Commit

Permalink
增加 MacOS 下的 CI/CD
Browse files Browse the repository at this point in the history
  • Loading branch information
nekosilverfox committed Oct 20, 2023
1 parent 7929b2c commit bea71f6
Showing 1 changed file with 36 additions and 7 deletions.
43 changes: 36 additions & 7 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ jobs:
qt_ver: [6.2.2]
qt_arch: [clang_64]
env:
targetName: PolyChatApp
targetName: PolyChat
# 在 Qt pro 文件中的
QtApplicationName: App
steps:
# macos 11.0 默认环境变了,要指定
- name: prepare env
Expand All @@ -37,18 +39,45 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Build on macOS
run: |
cd ./App
qmake
make
- name: Test on macOS
run: |
cd ../Tester
echo '-------------------'
cd ./Tester
echo '-------------------'
ls
qmake CONFIG+=debug
make
ls
./PolyChatTester -v2 -txt
echo '\n\n==============================./PolyChatTester -txt==============================\n\n'
./PolyChatTester -txt
- name: Build on macOS
run: |
ls
cd ./${QtApplicationName}
qmake
make
# 打包
- name: Package
run: |
ls
cd ./${QtApplicationName}
echo '------------------'
ls
# 拷贝依赖 pro文件里的名称:
macdeployqt ${QtApplicationName}.app -qmldir=. -verbose=1 -dmg
# 上传artifacts
- uses: actions/upload-artifact@v2
with:
name: ${{ env.targetName }}_${{ matrix.os }}_${{matrix.qt_ver}}.zip
path: ${QtApplicationName}.app
# tag 上传Release
- name: uploadRelease
if: startsWith(github.event.ref, 'refs/tags/')
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${QtApplicationName}.dmg
asset_name: ${{ env.targetName }}_${{ matrix.os }}_${{ matrix.qt_ver }}.dmg
tag: ${{ github.ref }}
overwrite: true

0 comments on commit bea71f6

Please sign in to comment.