1- name : build_macos
1+ # Author: Kang Lin <[email protected] >2+
3+ name : macos
24
35on :
46 workflow_call :
911
1012env :
1113 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
12-
14+
1315jobs :
1416 build_macos :
1517 strategy :
1618 matrix :
17- # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
18- BUILD_TYPE : [Release, Debug]
19- qt_version : [5.15.2, 5.12.12]
2019 include :
21- # - qt_version: 6.4.2
22- # qt_modules: qtscxml qtpositioning qt5compat
23-
24- - qt_version : 5.15.2
25- qt_modules : " "
26- - qt_version : 5.12.12
27- qt_modules : " "
20+ - VCPKG_TARGET_TRIPLET : x64-osx
21+ os : macos-15-intel
22+ qt_version : 6.9.3
23+ qt_arch : clang_64
24+ WITH_MACOSX_BUNDLE : false
2825
29- runs-on : macos-latest
26+ - VCPKG_TARGET_TRIPLET : arm64-osx
27+ os : macos-14
28+ qt_version : 6.9.3
29+ qt_arch : clang_64
30+ WITH_MACOSX_BUNDLE : true
31+
32+ - VCPKG_TARGET_TRIPLET : arm64-osx
33+ os : macos-14
34+ qt_version : 6.9.3
35+ qt_arch : clang_64
36+ WITH_MACOSX_BUNDLE : false
37+
38+ # See: [About GitHub-hosted runners](https://docs.github.com/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners)
39+ # See: [Choosing the runner for a job](https://docs.github.com/actions/writing-workflows/choosing-where-your-workflow-runs/choosing-the-runner-for-a-job)
40+ # See: https://github.com/actions/runner-images/
41+ runs-on : ${{matrix.os}}
3042
3143 env :
3244 BUILD_TYPE : ${{ matrix.BUILD_TYPE }}
3345 SOURCE_DIR : ${{github.workspace}}/.cache/source
34- TOOSL_DIR : ${{github.workspace}}/.cache/tools
46+ TOOLS_DIR : ${{github.workspace}}/.cache/tools
3547 INSTALL_DIR : ${{github.workspace}}/.cache/install_macos_qt${{matrix.qt_version}}_${{matrix.BUILD_TYPE}}
36- qt_modules : ${{matrix.qt_modules}}
37- RabbitIM_VERSION : v1.0.9
38- VCPKGGITCOMMITID : 2b1757dd1d5ed7d9d5bb65fd8316631b157e7afc
48+ BUILD_DIR : ${{github.workspace}}/build
49+ qt_modules : " qtscxml qtmultimedia qtserialport qt5compat qtwebsockets qtpositioning qtwebchannel qtwebengine"
50+ VCPKG_TARGET_TRIPLET : ${{matrix.VCPKG_TARGET_TRIPLET}}
51+ VCPKG_DEFAULT_TRIPLET : ${{matrix.VCPKG_TARGET_TRIPLET}}
52+ VCPKGGITCOMMITID : 7213cf8135c329c37c7e2778e40774489a0583a8
3953 artifact_name : build_macos
54+ RabbitIM_VERSION : v1.0.9
4055
4156 # Map the job outputs to step outputs
4257 outputs :
@@ -47,62 +62,85 @@ jobs:
4762 uses : actions/checkout@v3
4863 with :
4964 submodules : true
65+ fetch-depth : 0
5066
5167 - name : Make directories
5268 run : |
5369 cmake -E make_directory ${{env.SOURCE_DIR}}
54- cmake -E make_directory ${{env.TOOSL_DIR }}
70+ cmake -E make_directory ${{env.TOOLS_DIR }}
5571 cmake -E make_directory ${{env.INSTALL_DIR}}
56- cmake -E make_directory ${{github.workspace}}/build
72+ cmake -E make_directory ${{env.BUILD_DIR}}
5773
5874 - name : Cache installed
59- uses : actions/cache@v3
75+ uses : actions/cache@v4
6076 id : cache-installed
6177 with :
6278 path : |
6379 ${{env.INSTALL_DIR}}
64- key : Cache-installed-macos
80+ key : install_macos_${{env.VCPKG_TARGET_TRIPLET}}
6581
6682 - name : run-vcpkg
67- uses : lukka/run-vcpkg@v7.4
83+ uses : lukka/run-vcpkg@v11
6884 with :
6985 vcpkgGitCommitId : ${{env.VCPKGGITCOMMITID}}
70- vcpkgDirectory : ${{runner.workspace}}/vcpkg/
71- # Since the cache must be invalidated when content of the vcpkg.json file changes, let's
72- # compute its hash and append this to the computed cache's key.
73- appendedCacheKey : cache-vcpkg-${{env.VCPKGGITCOMMITID}}
74- vcpkgArguments : ' openssl libssh libpng pixman libjpeg-turbo libdatachannel freerdp'
86+ vcpkgDirectory : ${{env.SOURCE_DIR}}/vcpkg
7587
76- - name : Cache Qt
77- id : cache-qt
78- uses : actions/cache@v1 # not v2!
79- with :
80- path : ${{env.TOOSL_DIR}}/qt
81- key : qt${{matrix.qt_version}}-${{matrix.qt_arch}}
82-
88+ - name : install nasm
89+ run : |
90+ # See: https://formulae.brew.sh/
91+ brew update
92+ brew install nasm autoconf automake libtool pkg-config zstd libpcap libvncserver # pcapplusplus qt qtkeychain
93+
8394 - name : Install Qt
84- # You may pin to the exact commit or the version.
85- # uses: jurplel/install-qt-action@a962fb91949c8e846a3e4a944d50e7ef5cc3a28a
8695 uses : jurplel/install-qt-action@v3
8796 with :
88- # Directory to install Qt
89- dir : ${{env.TOOSL_DIR}}/qt # optional
90- # Version of Qt to install
91- version : ${{matrix.qt_version}} # optional, default is 5.15.2
92- modules : ${{env.qt_modules}} # optional
97+ dir : ' ${{env.TOOLS_DIR}}/qt' # optional
98+ version : ' ${{matrix.qt_version}}' # optional, default is 5.15.2
99+ arch : ' ${{matrix.qt_arch}}' # optional
100+ modules : ' ${{env.qt_modules}}' # optional. See: https://ddalcino.github.io/aqt-list-server/
101+ cache : true
102+ cache-key-prefix : cached-qt_${{matrix.qt_version}}_${{matrix.qt_arch}}
93103
104+ - name : build qxmpp
105+ working-directory : ${{env.SOURCE_DIR}}
106+ run : |
107+ if [ ! -d ${{env.INSTALL_DIR}}/lib/cmake/qxmpp ]; then
108+ git clone -b v1.10.3 https://invent.kde.org/libraries/qxmpp.git
109+ cd qxmpp
110+ cmake -E make_directory build
111+ cd build
112+ cmake .. \
113+ -DCMAKE_BUILD_TYPE=Release \
114+ -DBUILD_EXAMPLES=OFF -DBUILD_TESTS=OFF \
115+ -DCMAKE_INSTALL_PREFIX=${{env.INSTALL_DIR}} \
116+ -DCMAKE_PREFIX_PATH=${{env.INSTALL_DIR}}/lib/cmake \
117+ -DCMAKE_TOOLCHAIN_FILE="${{env.VCPKG_ROOT}}/scripts/buildsystems/vcpkg.cmake" \
118+ -DX_VCPKG_APPLOCAL_DEPS_INSTALL=ON \
119+ -DVCPKG_VERBOSE=ON \
120+ -DVCPKG_TARGET_TRIPLET=${{matrix.VCPKG_TARGET_TRIPLET}}
121+ cmake --build . --config Release
122+ cmake --install . --config Release --strip
123+ fi
124+
94125 - name : Compile
95126 working-directory : ${{github.workspace}}/build
96127 run : |
97128 cmake ${{github.workspace}} \
98129 -DCMARK_SHARED=OFF \
99130 -DCMARK_TESTS=OFF \
100131 -DCMARK_STATIC=ON \
101- -Dcmark-gfm_DIR=${{env.INSTALL_DIR}}/lib/cmake \
102- -DCMAKE_BUILD_TYPE=${{ matrix.BUILD_TYPE }} \
132+ -DWITH_CMARK=OFF \
133+ -DWITH_CMARK_GFM=ON \
134+ -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
135+ -DCMAKE_BUILD_TYPE=Release \
103136 -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/build/install \
104137 -DCMAKE_PREFIX_PATH=${{env.INSTALL_DIR}}/lib/cmake \
105- -DCMAKE_TOOLCHAIN_FILE="${{env.VCPKG_ROOT}}/scripts/buildsystems/vcpkg.cmake"
138+ -DCMAKE_TOOLCHAIN_FILE="${{env.VCPKG_ROOT}}/scripts/buildsystems/vcpkg.cmake" \
139+ -DX_VCPKG_APPLOCAL_DEPS_INSTALL=ON \
140+ -DVCPKG_VERBOSE=ON \
141+ -DVCPKG_TARGET_TRIPLET=${{matrix.VCPKG_TARGET_TRIPLET}} \
142+ -DRABBIT_WITH_MACDEPLOY=OFF \
143+ -DWITH_MACOSX_BUNDLE=ON
106144 cmake --build . --config ${{ matrix.BUILD_TYPE }} --target install
107145 cmake --build . --config ${{ matrix.BUILD_TYPE }} --target package
108146 7z a RabbitCommon_${{env.RabbitIM_VERSION}}_macos.zip ./install/*
0 commit comments