QProperty 换回宏, moc参数中设置flavor为msvc即可 #299
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: MacOS | |
on: | |
# push代码时触发workflow | |
push: | |
paths: | |
- '3rdparty/**' | |
- 'examples/**' | |
- 'mkspecs/**' | |
- 'src/**' | |
- '.qmake.conf' | |
- 'TaoQuick.pro' | |
- '.github/workflows/macos.yml' | |
# pull_request时触发workflow | |
pull_request: | |
paths: | |
- '3rdparty/**' | |
- 'examples/**' | |
- 'mkspecs/**' | |
- 'src/**' | |
- '.qmake.conf' | |
- 'TaoQuick.pro' | |
- '.github/workflows/macos.yml' | |
jobs: | |
build: | |
name: Build | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [macos-10.15,macos-11.0,macos-12] | |
qt_ver: [5.9.9,5.12.10,5.15.2] | |
qt_arch: [clang_64] | |
env: | |
targetName: TaoQuickShow | |
steps: | |
- name: prepare env | |
if: ${{ matrix.os == 'macos-11.0' }} | |
run: | | |
softwareupdate --all --install --force | |
sudo xcode-select --print-path | |
sudo xcode-select --switch /Library/Developer/CommandLineTools | |
- name: Install Qt | |
uses: jurplel/install-qt-action@v2 | |
with: | |
version: ${{ matrix.qt_ver }} | |
cached: 'false' | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 1 | |
submodules: 'true' | |
- name: build macos | |
run: | | |
qmake | |
make | |
# 打包 | |
- name: package | |
run: | | |
# 拷贝依赖 | |
macdeployqt bin/release/${targetName}.app -qmldir=. -verbose=1 -dmg | |
# 上传artifacts | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: ${{ env.targetName }}_${{matrix.qt_ver}}.zip | |
path: bin/release/${{ env.targetName }}.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: bin/release/${{ env.targetName }}.dmg | |
asset_name: ${{ env.targetName }}_${{ matrix.os }}_${{ matrix.qt_ver }}.dmg | |
tag: ${{ github.ref }} | |
overwrite: true |