Skip to content

更新为最新的cmake内容 #35

更新为最新的cmake内容

更新为最新的cmake内容 #35

Workflow file for this run

name: MacOS
on:
# push代码时触发workflow
push:
branches:
- master
- main
tags:
- "*"
# 忽略README.md
paths-ignore:
- '*.md'
- 'LICENSE'
- 'Doxyfile.in'
- '.clang-format'
- '.git*'
- '.github/workflows/ubuntu.yml'
- '.github/workflows/windows.yml'
- 'scripts/windows*'
# pull_request时触发workflow
pull_request:
paths-ignore:
- '*.md'
- 'LICENSE'
- 'Doxyfile.in'
- '.clang-format'
- '.git*'
- '.github/workflows/ubuntu.yml'
- '.github/workflows/windows.yml'
- 'scripts/windows*'
jobs:
build:
name: CI
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest]
qt_version: [5.15.2,6.3.0]
qt_arch: [clang_64]
build_type: [Release]
env:
targetName: exedemo
steps:
- name: Checkout Code
uses: actions/checkout@v2
with:
submodules: true
# macos 11.0 默认环境变了,要指定
- 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
# 安装Qt
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: ${{ matrix.qt_version }}
modules: ${{ matrix.modules }}
- uses: actions/setup-node@v1
if: matrix.platform == 'macos-latest'
with:
node-version: "12.x"
- run: npm install -g appdmg
if: matrix.platform == 'macos-latest'
# build
- name: ${{ matrix.os }} - ${{ matrix.qt_versionsion }} - Generate Dependencies and Build
shell: bash
env:
PKG_CONFIG_PATH: /usr/local/opt/[email protected]/lib/pkgconfig
run: |
cmake -S . -Bbuild -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DDS_STORE_SCRIPT=ON
cmake --build build --config ${{ matrix.build_type }} --parallel $(sysctl -n hw.logicalcpu)
# # 打包
# - name: package
# # 拷贝依赖
# run: |
# pwd
# ls build/bin/${{ matrix.build_type }}/
# macdeployqt build/bin/${{ matrix.build_type }}/${{ env.targetName }} -verbose=1 -dmg
# # 上传artifacts
# - uses: actions/upload-artifact@v2
# with:
# name: ${{ env.targetName }}_${{ matrix.os }}_${{matrix.qt_version}}.zip
# path: build/bin/${{ matrix.build_type }}/${{ env.targetName }}
# # tag 上传Release
# - name: upload ${{ matrix.build_type }}
# if: startsWith(github.event.ref, 'refs/tags/')
# uses: svenstaro/upload-release-action@v2
# with:
# repo_token: ${{ secrets.GITHUB_TOKEN }}
# file: build/bin/${{ matrix.build_type }}/${{ env.targetName }}.dmg
# asset_name: ${{ env.targetName }}_${{ matrix.os }}_${{ matrix.qt_version }}.dmg
# tag: ${{ github.ref }}
# overwrite: true