Skip to content

Commit fce2954

Browse files
committed
CI: modify ci
1 parent eb1b983 commit fce2954

File tree

7 files changed

+234
-140
lines changed

7 files changed

+234
-140
lines changed

.github/workflows/android.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ jobs:
2424

2525
env:
2626
SOURCE_DIR: ${{github.workspace}}/.cache/source
27-
TOOSL_DIR: ${{github.workspace}}/.cache/tools
27+
TOOLS_DIR: ${{github.workspace}}/.cache/tools
28+
BUILD_DIR: ${{github.workspace}}/build
2829
INSTALL_DIR: ${{github.workspace}}/.cache/install_anrdoi_qt${{matrix.qt_version}}_${{matrix.qt_arch}}_${{matrix.BUILD_TYPE}}
2930
RabbitIM_VERSION: v0.0.25
3031
VCPKGGITCOMMITID: 6adca01a3fadca0cc0b80f03ec57c7c3a0be5c02
@@ -40,14 +41,15 @@ jobs:
4041
- name: make directory
4142
run: |
4243
cmake -E make_directory ${{env.SOURCE_DIR}}
43-
cmake -E make_directory ${{env.TOOSL_DIR}}
44+
cmake -E make_directory ${{env.TOOLS_DIR}}
4445
cmake -E make_directory ${{env.INSTALL_DIR}}
46+
cmake -E make_directory ${{env.BUILD_DIR}}
4547
4648
- name: Cache Qt
4749
id: cache-qt
4850
uses: actions/cache@v1 # not v2!
4951
with:
50-
path: ${{env.TOOSL_DIR}}/qt
52+
path: ${{env.TOOLS_DIR}}/qt
5153
key: qt_${{matrix.qt_version}}_${{matrix.qt_arch}}
5254

5355
- name: Install Qt
@@ -56,7 +58,7 @@ jobs:
5658
uses: jurplel/install-qt-action@v3
5759
with:
5860
# Directory to install Qt
59-
dir: '${{env.TOOSL_DIR}}/qt' # optional
61+
dir: '${{env.TOOLS_DIR}}/qt' # optional
6062
# Version of Qt to install
6163
version: '${{matrix.qt_version}}' # optional, default is 5.15.2
6264
# Host platform

.github/workflows/build.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,34 @@
1+
# Author: Kang Lin<[email protected]>
2+
# workflow syntax: https://docs.github.com/actions/writing-workflows/workflow-syntax-for-github-actions
3+
14
name: build
25

36
env:
47
artifact_path: artifact_path
58
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9+
RabbitIM_VERSION: 0.1.0
10+
RabbitIM_VERSION_PRE: 0.1.0
611

712
on:
813
push:
914
pull_request:
10-
15+
1116
jobs:
1217
ubuntu:
1318
uses: ./.github/workflows/ubuntu.yml
19+
secrets: inherit
1420

1521
msvc:
1622
uses: ./.github/workflows/msvc.yml
23+
secrets: inherit
1724

1825
mingw:
1926
uses: ./.github/workflows/mingw.yml
27+
secrets: inherit
2028

2129
macos:
2230
uses: ./.github/workflows/macos.yml
31+
secrets: inherit
2332

2433
deploy:
2534
if: ${{ startsWith(github.ref, 'refs/tags/') }}

.github/workflows/doxygen.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
env:
1212
BUILD_TYPE: Release
1313
SOURCE_DIR: ${{github.workspace}}/.cache/source
14-
TOOSL_DIR: ${{github.workspace}}/.cache/tools
14+
TOOLS_DIR: ${{github.workspace}}/.cache/tools
1515
INSTALL_DIR: ${{github.workspace}}/.cache/install_ubuntu
1616
RabbitRemoteControl_VERSION: v0.0.27
1717
DOXYGEN_VERSION: 1.9.5
@@ -24,15 +24,15 @@ jobs:
2424
- name: make_directory
2525
run: |
2626
cmake -E make_directory ${{env.SOURCE_DIR}}
27-
cmake -E make_directory ${{env.TOOSL_DIR}}
27+
cmake -E make_directory ${{env.TOOLS_DIR}}
2828
cmake -E make_directory ${{env.INSTALL_DIR}}
2929
3030
- name: Cache installed
3131
uses: actions/cache@v2
3232
id: cache-installed
3333
with:
3434
path: |
35-
${{env.TOOSL_DIR}}
35+
${{env.TOOLS_DIR}}
3636
key: cache-installed-doxygen
3737

3838
- name: git clone RabbitCommon
@@ -49,12 +49,12 @@ jobs:
4949

5050
- name: Download doxygen
5151
run: |
52-
if [ ! -d ${{env.TOOSL_DIR}}/doxygen-${{env.DOXYGEN_VERSION}} ]; then
53-
cd ${{env.TOOSL_DIR}}
52+
if [ ! -d ${{env.TOOLS_DIR}}/doxygen-${{env.DOXYGEN_VERSION}} ]; then
53+
cd ${{env.TOOLS_DIR}}
5454
wget https://www.doxygen.nl/files/doxygen-${{env.DOXYGEN_VERSION}}.linux.bin.tar.gz
5555
tar xzf doxygen-${{env.DOXYGEN_VERSION}}.linux.bin.tar.gz
5656
fi
57-
sudo cp ${{env.TOOSL_DIR}}/doxygen-${{env.DOXYGEN_VERSION}}/bin/doxygen /usr/bin/doxygen
57+
sudo cp ${{env.TOOLS_DIR}}/doxygen-${{env.DOXYGEN_VERSION}}/bin/doxygen /usr/bin/doxygen
5858
5959
- name: build doxygen
6060
working-directory: ${{github.workspace}}

.github/workflows/macos.yml

Lines changed: 82 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
name: build_macos
1+
# Author: Kang Lin <[email protected]>
2+
3+
name: macos
24

35
on:
46
workflow_call:
@@ -9,34 +11,47 @@ on:
911

1012
env:
1113
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
12-
14+
1315
jobs:
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/*

.github/workflows/mingw.yml

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
name: build_mingw
1+
# Author: Kang Lin <[email protected]>
2+
3+
name: mingw
24

35
on:
46
workflow_call:
@@ -9,22 +11,25 @@ on:
911

1012
jobs:
1113
build_mingw:
12-
name: build mingw
1314

1415
strategy:
1516
matrix:
16-
BUILD_TYPE: [Release, Debug]
17+
BUILD_TYPE: [Release]
1718

1819
defaults:
1920
run:
2021
shell: cmd
2122

23+
# See: [About GitHub-hosted runners](https://docs.github.com/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners)
24+
# 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)
25+
# See: https://github.com/actions/runner-images/
2226
runs-on: windows-latest
2327

2428
env:
2529
BUILD_TYPE: ${{ matrix.BUILD_TYPE }}
30+
BUILD_DIR: ${{github.workspace}}\build
2631
SOURCE_DIR: ${{github.workspace}}\.cache\source
27-
TOOSL_DIR: ${{github.workspace}}\.cache\tools
32+
TOOLS_DIR: ${{github.workspace}}\.cache\tools
2833
INSTALL_DIR: ${{github.workspace}}\.cache\install_mingw_${{matrix.BUILD_TYPE}}
2934
RabbitIM_VERSION: v0.0.27
3035
artifact_name: build_mingw
@@ -37,12 +42,14 @@ jobs:
3742
- name: Checkout Repository
3843
uses: actions/checkout@v3
3944
with:
40-
submodules: true
45+
submodules: recursive
46+
fetch-depth: 0
4147

4248
- name: pacman
4349
env:
4450
PATH: C:\msys64\usr\bin
45-
run: |
51+
run: |
52+
C:\msys64\usr\bin\pacman.exe -Syu --noconfirm
4653
C:\msys64\usr\bin\pacman.exe -S --noconfirm ^
4754
mingw-w64-x86_64-cmake ^
4855
mingw-w64-x86_64-make ^
@@ -65,17 +72,18 @@ jobs:
6572
6673
- name: make_directory
6774
run: |
75+
cmake -E make_directory ${{env.BUILD_DIR}}
6876
cmake -E make_directory ${{env.SOURCE_DIR}}
69-
cmake -E make_directory ${{env.TOOSL_DIR}}
77+
cmake -E make_directory ${{env.TOOLS_DIR}}
7078
cmake -E make_directory ${{env.INSTALL_DIR}}
7179
7280
- name: Cache installed
73-
uses: actions/cache@v3
81+
uses: actions/cache@v4
7482
id: cache-installed
7583
with:
7684
path: |
7785
${{env.INSTALL_DIR}}
78-
key: cache-installed-mingw
86+
key: install_mingw_${{matrix.BUILD_TYPE}}
7987

8088
- name: git clone RabbitCommon
8189
working-directory: ${{env.SOURCE_DIR}}
@@ -96,14 +104,8 @@ jobs:
96104
-DCMARK_STATIC=ON ^
97105
-DCMAKE_BUILD_TYPE=${{matrix.BUILD_TYPE}} ^
98106
-DCMAKE_INSTALL_PREFIX=${{github.workspace}}/build/install ^
99-
-DBUILD_FREERDP=ON ^
100-
-DBUILD_LibVNCServer=OFF ^
101-
-Dtigervnc_DIR=${{env.INSTALL_DIR}}/lib/cmake ^
102-
-Dlibdatachannel_DIR=${{env.INSTALL_DIR}}/share/cmake/libdatachannel ^
103-
-DQtService_DIR=${{env.INSTALL_DIR}}/lib/cmake/QtService ^
104107
-DCMAKE_PREFIX_PATH=${{env.INSTALL_DIR}}
105108
cmake --build . --config ${{ matrix.BUILD_TYPE }}
106-
cmake --build . --config ${{ matrix.BUILD_TYPE }} --target install
107109
108110
- name: Package
109111
if: ${{ matrix.BUILD_TYPE == 'Release' }}

0 commit comments

Comments
 (0)