Skip to content

Commit

Permalink
Merge pull request #149 from NekoSilverFox/MengJianing
Browse files Browse the repository at this point in the history
增加 多版本包的编译
  • Loading branch information
NekoSilverFox authored Oct 23, 2023
2 parents ff345e6 + 132377d commit be5c2e9
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 10 deletions.
21 changes: 14 additions & 7 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: macOS Build and Test
name: macOS CI/CD
on:
push:
paths:
Expand All @@ -12,16 +12,16 @@ on:
- '.github/workflows/macos.yml'
jobs:
build:
name: Build
name: CICD
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-11.0]
qt_ver: [6.2.2]
qt_ver: [6.2.2, 6.6.0]
qt_arch: [clang_64]
env:
targetName: PolyChat
# 在 Qt pro 文件中的
# 在 Qt pro 文件中的 TARGET
QtApplicationName: App
steps:
# macos 11.0 默认环境变了,要指定
Expand All @@ -30,15 +30,21 @@ jobs:
run: |
softwareupdate --all --install --force
sudo xcode-select --print-path
sudo xcode-select --switch /Library/Developer/CommandLineTools
sudo xcode-select --switch /Library/Developer/CommandLineTools
#参考:https://ddalcino.github.io/aqt-list-server/
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: ${{ matrix.qt_ver }}
cached: 'false'
#下面这几行不用也可以,删除不必要的控件能减少包体积
aqtversion: '==3.1.*'
# modules: 'qtnetworkauth'
# tools: 'tools_qtcreator'
- uses: actions/checkout@v2
with:
fetch-depth: 1
# MacOS 下测试(使用 QTest)
- name: Test on macOS
run: |
echo '-------------------'
Expand All @@ -50,14 +56,15 @@ jobs:
./PolyChatTester -v2 -txt
echo '\n\n==============================./PolyChatTester -txt==============================\n\n'
./PolyChatTester -txt
# 编译 Release 版本
- name: Build on macOS
run: |
ls
cd ./${QtApplicationName}
qmake
make
# 打包
- name: Package
- name: Package on MacOS
run: |
cd ./${QtApplicationName}
# mv ./${QtApplicationName}/${QtApplicationName}.app .
Expand All @@ -71,7 +78,7 @@ jobs:
name: ${{ env.targetName }}_${{ matrix.os }}_${{matrix.qt_ver}}.zip
path: ${{ env.QtApplicationName }}/${{ env.QtApplicationName }}.app
# tag 上传Release
- name: uploadRelease
- name: Upload Release
if: startsWith(github.event.ref, 'refs/tags/')
uses: svenstaro/upload-release-action@v2
with:
Expand Down
17 changes: 14 additions & 3 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Windows Build and Test
name: Windows CD/CD
on:
# push代码时触发workflow
push:
Expand Down Expand Up @@ -28,6 +28,11 @@ jobs:
qt_arch: win64_msvc2019_64
msvc_arch: x64
qt_arch_install: msvc2019_64

- qt_ver: 6.6.0
qt_arch: win64_msvc2019_64
msvc_arch: x64
qt_arch_install: msvc2019_64
env:
# 在 Qt pro 文件中的
QtApplicationName: App.exe
Expand All @@ -44,12 +49,18 @@ jobs:
# target: ${{ matrix.qt_target }}
arch: ${{ matrix.qt_arch }}
cached: 'false'
aqtversion: '==2.0.5'
aqtversion: '==3.1.*'
#下面这几行不用也可以,删除不必要的控件能减少包体积
# host: 'windows'
# target: 'desktop'
# toolsOnly: 'true'
# modules: 'qtnetworkauth'
# tools: 'tools_qtcreator_gui'
# 拉取代码
- uses: actions/checkout@v2
with:
fetch-depth: 1
# msvc测试
# msvc测试(使用 QTest)
- name: msvc-test
id: test
shell: cmd
Expand Down

0 comments on commit be5c2e9

Please sign in to comment.