FluentUI/.github/workflows/macos.yml

74 lines
2.2 KiB
YAML
Raw Normal View History

2023-03-08 00:12:02 +08:00
name: MacOS
on:
push:
paths:
2023-04-27 09:38:57 +08:00
- '*.txt'
- 'example/**'
2023-03-08 00:12:02 +08:00
- 'src/**'
2023-04-27 09:38:57 +08:00
- 'scripts/**'
2023-03-08 00:12:02 +08:00
- '.github/workflows/macos.yml'
pull_request:
paths:
2023-04-27 09:38:57 +08:00
- '*.txt'
- 'example/**'
2023-03-08 00:12:02 +08:00
- 'src/**'
2023-04-27 09:38:57 +08:00
- 'scripts/**'
2023-03-08 00:12:02 +08:00
- '.github/workflows/macos.yml'
2023-04-27 09:38:57 +08:00
2023-03-08 00:12:02 +08:00
jobs:
build:
name: Build
runs-on: ${{ matrix.os }}
strategy:
matrix:
2023-04-02 23:36:23 +08:00
os: [macos-12]
2023-03-30 21:52:55 +08:00
qt_ver: [6.4.3]
2023-03-08 00:12:02 +08:00
qt_arch: [clang_64]
env:
targetName: example
steps:
2023-04-27 09:38:57 +08:00
- name: Check out repository
uses: actions/checkout@v3
2023-04-02 23:36:23 +08:00
with:
2023-04-27 09:38:57 +08:00
submodules: recursive
2023-03-08 00:12:02 +08:00
- name: Install Qt
2023-03-30 22:18:42 +08:00
uses: jurplel/install-qt-action@v3
2023-03-08 00:12:02 +08:00
with:
version: ${{ matrix.qt_ver }}
2023-04-02 23:36:23 +08:00
cache: ${{steps.cache-qt.outputs.cache-hit}}
2023-03-30 22:18:42 +08:00
arch: ${{ matrix.qt_arch }}
2023-03-30 23:25:48 +08:00
modules: 'qt5compat qtmultimedia qtshadertools qtimageformats'
2023-04-27 09:38:57 +08:00
- name: Set up Ninja
uses: seanmiddleditch/gha-setup-ninja@v3
2023-03-08 00:12:02 +08:00
with:
2023-04-27 09:38:57 +08:00
version: 1.10.2
2023-03-08 00:12:02 +08:00
- name: build macos
run: |
2023-04-27 09:38:57 +08:00
cmake --version
mkdir build
cd build
2023-05-05 21:58:39 +08:00
cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_PREFIX_PATH=/Users/runner/work/FluentUI/Qt/6.4.3/macos -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Release -GNinja ..
2023-04-27 09:38:57 +08:00
cmake --build . --target all --config Release --parallel
2023-03-08 00:12:02 +08:00
- name: package
run: |
# 拷贝依赖
2023-04-27 09:38:57 +08:00
macdeployqt bin/release/${targetName}.app -qmldir=. -verbose=1 -dmg
2023-03-08 00:12:02 +08:00
- uses: actions/upload-artifact@v2
with:
2023-03-25 13:35:21 +08:00
name: ${{ env.targetName }}_${{ matrix.os }}_${{matrix.qt_ver}}.zip
2023-03-08 00:12:02 +08:00
path: bin/release/${{ env.targetName }}.app
2023-04-27 09:38:57 +08:00
2023-03-08 00:12:02 +08:00
- 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 }}_${{ github.ref_name }}_${{ matrix.os }}_Qt${{ matrix.qt_ver }}.dmg
2023-03-08 00:12:02 +08:00
tag: ${{ github.ref }}
overwrite: true