-
-
Notifications
You must be signed in to change notification settings - Fork 27
111 lines (97 loc) · 3.69 KB
/
ubuntu.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: build_ubuntu
on:
workflow_call:
outputs:
name:
description: "The artifact name"
value: ${{ jobs.build_ubuntu.outputs.name }}
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
jobs:
build_ubuntu:
strategy:
matrix:
BUILD_TYPE: [Release, Debug]
runs-on: ubuntu-latest
env:
SOURCE_DIR: ${{github.workspace}}/.cache/source
TOOSL_DIR: ${{github.workspace}}/.cache/tools
INSTALL_DIR: ${{github.workspace}}/.cache/install
ChineseChessControl_VERSION: "2.0.13"
artifact_name: build_ubuntu
# Map the job outputs to step outputs
outputs:
name: ${{ env.artifact_name }}
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
submodules: recursive
- name: make_directory
run: |
cmake -E make_directory ${{env.SOURCE_DIR}}
cmake -E make_directory ${{env.TOOSL_DIR}}
cmake -E make_directory ${{env.INSTALL_DIR}}
cmake -E make_directory ${{github.workspace}}/build
- name: Install apt packages
run: |
sudo apt update
sudo apt upgrade
sudo apt install xvfb xpra \
libglu1-mesa-dev libpulse-mainloop-glib0 \
cmake build-essential \
debhelper fakeroot graphviz \
qt6-tools-dev qt6-tools-dev-tools \
qt6-base-dev qt6-base-dev-tools \
qt6-l10n-tools qt6-translations-l10n \
qt6-scxml-dev qt6-webengine-dev qt6-webengine-dev-tools \
qt6-multimedia-dev libqt6svg6-dev
- name: Cache installed
uses: actions/cache@v2
id: cache-installed
with:
path: |
${{env.INSTALL_DIR}}
key: install_ubuntu_${{matrix.BUILD_TYPE}}
- name: git clone RabbitCommon
working-directory: ${{env.SOURCE_DIR}}
run: |
git clone https://github.com/KangLin/RabbitCommon.git
- name: Build develop library
working-directory: ${{github.workspace}}/build
env:
RabbitCommon_DIR: ${{env.SOURCE_DIR}}/RabbitCommon
run: |
cmake ${{github.workspace}} \
-DCMARK_SHARED=OFF \
-DCMARK_TESTS=OFF \
-DCMARK_STATIC=ON \
-DINSTALL_QT=OFF \
-DBUILD_APP=OFF \
-DCMAKE_BUILD_TYPE=${{ matrix.BUILD_TYPE }} \
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/build/install_dev \
-DCMAKE_PREFIX_PATH=${{env.INSTALL_DIR}}/lib/cmake
cmake --build . --config ${{ matrix.BUILD_TYPE }} --target install
7z a ChineseChessControl_${{env.ChineseChessControl_VERSION}}_Linux_${{ matrix.BUILD_TYPE }}.zip ./install_dev/*
- name: build ChineseChessControl
working-directory: ${{github.workspace}}/build
env:
RabbitCommon_DIR: ${{env.SOURCE_DIR}}/RabbitCommon
run: |
cmake ${{github.workspace}} \
-DCMARK_SHARED=OFF \
-DCMARK_TESTS=OFF \
-DCMARK_STATIC=ON \
-DCMAKE_BUILD_TYPE=${{matrix.BUILD_TYPE}} \
-DCMAKE_INSTALL_PREFIX=${{github.workspace}}/build/install
cmake --build . --config ${{matrix.BUILD_TYPE}}
cpack -G "DEB;STGZ"
- name: Update artifact
if: ${{ matrix.BUILD_TYPE == 'Release' }}
uses: actions/upload-artifact@v2
with:
name: ${{ env.artifact_name }}
path: |
${{github.workspace}}/build/chinesechesscontrol_*.deb
${{github.workspace}}/build/chinesechesscontrol_*.sh
${{github.workspace}}/build/ChineseChessControl_${{env.ChineseChessControl_VERSION}}_Linux_${{ matrix.BUILD_TYPE }}.zip