FluentUI/.github/workflows/macos.yml

64 lines
1.8 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-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-02 23:36:23 +08:00
- name: '⚙️ Cache Qt'
id: cache-qt
uses: actions/cache@v3
with:
path: ${{ runner.workspace }}/Qt
key: ${{runner.os}}-qtcachedir-${{ matrix.qt_ver }}
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-03-08 00:12:02 +08:00
- uses: actions/checkout@v2
with:
fetch-depth: 1
- name: build macos
run: |
qmake
make
# 打包
- name: package
run: |
# 拷贝依赖
2023-03-25 11:54:07 +08:00
macdeployqt bin/release/${targetName}.app -qmldir=. -verbose=1 -dmg
2023-03-08 00:12:02 +08:00
# 上传artifacts
- 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
# 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 }}_${{ github.ref_name }}_${{ matrix.os }}_Qt${{ matrix.qt_ver }}.dmg
2023-03-08 00:12:02 +08:00
tag: ${{ github.ref }}
overwrite: true