FluentUI/.github/workflows/macos.yml

66 lines
1.9 KiB
YAML
Raw Normal View History

2023-03-08 00:12:02 +08:00
name: MacOS
on:
push:
paths:
- '*.pro'
- 'src/**'
- '.github/workflows/macos.yml'
pull_request:
paths:
- '*.pro'
- 'src/**'
- '.github/workflows/macos.yml'
jobs:
build:
name: Build
runs-on: ${{ matrix.os }}
strategy:
matrix:
2023-03-25 11:34:26 +08:00
os: [macos-11.0]
2023-03-24 20:44:38 +08:00
qt_ver: [6.4.3]
2023-03-08 00:12:02 +08:00
qt_arch: [clang_64]
env:
targetName: example
steps:
# 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
- name: Install Qt
2023-03-25 10:31:12 +08:00
uses: jurplel/install-qt-action@v3
2023-03-08 00:12:02 +08:00
with:
version: ${{ matrix.qt_ver }}
2023-03-25 10:31:12 +08:00
modules: 'qtmultimedia qt5compat qtshadertools'
2023-03-25 11:34:26 +08:00
aqtversion: '==2.1.*'
arch: ${{ matrix.qt_arch }}
2023-03-08 00:12:02 +08:00
cached: 'false'
- uses: actions/checkout@v2
with:
fetch-depth: 1
- 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.os }}_${{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