-
-
Notifications
You must be signed in to change notification settings - Fork 78
179 lines (161 loc) · 7.09 KB
/
docker.yml
File metadata and controls
179 lines (161 loc) · 7.09 KB
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
# Author: Kang Lin <kl222@126.com>
name: docker
on:
workflow_call:
outputs:
name:
description: "The artifact name"
value: ${{ jobs.build_docker.outputs.name }}
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
jobs:
build_docker:
strategy:
matrix:
variant:
- PACKAGE: deb
image: ubuntu
lable: "25.04"
os: ubuntu-24.04
- PACKAGE: deb
image: ubuntu
lable: "25.04"
os: ubuntu-24.04-arm
- PACKAGE: deb
image: ubuntu
lable: "26.04"
os: ubuntu-24.04
- PACKAGE: deb
image: ubuntu
lable: "26.04"
os: ubuntu-24.04-arm
- PACKAGE: deb
image: debian
lable: "12"
os: ubuntu-24.04
- PACKAGE: deb
image: debian
lable: "12"
os: ubuntu-24.04-arm
- PACKAGE: deb
image: debian
lable: "13"
os: ubuntu-24.04
- PACKAGE: deb
image: debian
lable: "13"
os: ubuntu-24.04-arm
- PACKAGE: appimage
image: ubuntu
lable: "25.04"
os: ubuntu-24.04
BUILD_VERBOSE: OFF
- PACKAGE: appimage
image: ubuntu
lable: "25.04"
os: ubuntu-24.04-arm
BUILD_VERBOSE: OFF
- PACKAGE: rpm
image: fedora
lable: "41"
os: ubuntu-24.04
- PACKAGE: rpm
image: fedora
lable: "41"
os: ubuntu-24.04-arm
# See: [About GitHub-hosted runners](https://docs.github.com/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners)
# 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)
# See: https://github.com/actions/runner-images/
runs-on: ${{matrix.variant.os}}
env:
RabbitRemoteControl_VERSION: 1.0.0-dev
artifact_name: build_docker
BUILD_DIR: ${{github.workspace}}/build
SOURCE_DIR: ${{github.workspace}}/.cache/source
TOOLS_DIR: ${{github.workspace}}/.cache/tools_${{matrix.variant.os}}
INSTALL_DIR: ${{github.workspace}}/.cache/install_docker_${{matrix.variant.PACKAGE}}_${{matrix.variant.image}}_${{matrix.variant.lable}}_${{matrix.variant.os}}
BUILD_VERBOSE: ${{matrix.variant.BUILD_VERBOSE}}
# Map the job outputs to step outputs
outputs:
name: ${{ env.artifact_name }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
- name: Make directories
run: |
cmake -E make_directory ${{env.BUILD_DIR}}
cmake -E make_directory ${{env.SOURCE_DIR}}
cmake -E make_directory ${{env.TOOLS_DIR}}
cmake -E make_directory ${{env.INSTALL_DIR}}
- name: Cache installed
uses: actions/cache@v4
id: cache-installed
with:
path: |
${{env.INSTALL_DIR}}
${{env.TOOLS_DIR}}/linuxdeploy-*
${{env.TOOLS_DIR}}/qt_*
key: install_docker_${{matrix.variant.PACKAGE}}_${{matrix.variant.image}}${{matrix.variant.lable}}_${{matrix.variant.os}}
- name: run docker
run: |
if [ -n "${{matrix.variant.lable}}" ]; then
docker_image="${{matrix.variant.image}}:${{matrix.variant.lable}}"
else
docker_image="${{matrix.variant.image}}"
fi
./Script/build_linux.sh --docker --docker-image="${docker_image}" --${{matrix.variant.PACKAGE}}
- name: Rename deb file
if: ${{ matrix.variant.PACKAGE == 'deb' }}
#continue-on-error: true
run: |
cd ${{env.BUILD_DIR}}/build_linux
if [ -n "${{matrix.variant.lable}}" ]; then
docker_image="${{matrix.variant.image}}${{matrix.variant.lable}}"
else
docker_image="${{matrix.variant.image}}"
fi
mv rabbitremotecontrol_*.deb rabbitremotecontrol_${{env.RabbitRemoteControl_VERSION}}_${docker_image}_`uname -m`.deb
- name: AppIagme update configure file
if: ${{ matrix.variant.PACKAGE == 'appimage' }}
#continue-on-error: true
run: |
# OpenGL
sudo apt update -y -q
sudo apt install -y -q libgl1-mesa-dev libglx-dev libglu1-mesa-dev libvulkan-dev mesa-common-dev
sudo apt install -y -q libfuse-dev libfuse3-dev
sudo Xvfb :91.0 -ac -screen 0 1200x900x24 &
sleep 1
export DISPLAY=:91.0
ARCH=`uname -m`
pushd ${{env.BUILD_DIR}}/build_linux/install
sudo mv -f RabbitRemoteControl_${ARCH}.AppImage RabbitRemoteControl_${{env.RabbitRemoteControl_VERSION}}_Linux_${ARCH}.AppImage
popd
pushd ${{env.BUILD_DIR}}/build_linux
mv install RabbitRemoteControl_${{env.RabbitRemoteControl_VERSION}}_Linux_${ARCH}_Setup
zip RabbitRemoteControl_${{env.RabbitRemoteControl_VERSION}}_Linux_${ARCH}_Setup.zip RabbitRemoteControl_${{env.RabbitRemoteControl_VERSION}}_Linux_${ARCH}_Setup/*
md5sum RabbitRemoteControl_${{env.RabbitRemoteControl_VERSION}}_Linux_${ARCH}_Setup.zip > RabbitRemoteControl_${{env.RabbitRemoteControl_VERSION}}_Linux_${ARCH}_Setup.zip.md5sum
MD5SUM=`cat RabbitRemoteControl_${{env.RabbitRemoteControl_VERSION}}_Linux_${ARCH}_Setup.zip.md5sum|awk '{print $1}'`
echo "MD5SUM RabbitRemoteControl_${{env.RabbitRemoteControl_VERSION}}_Linux_${ARCH}_Setup.zip: ${MD5SUM}"
echo "Generate update configure file ......"
pushd RabbitRemoteControl_${{env.RabbitRemoteControl_VERSION}}_Linux_${ARCH}_Setup
./RabbitRemoteControl_${{env.RabbitRemoteControl_VERSION}}_Linux_${ARCH}.AppImage \
-f "${{github.workspace}}/update_appimage_${{matrix.variant.os}}.json" \
--foc 1 \
--file-name ../RabbitRemoteControl_${{env.RabbitRemoteControl_VERSION}}_Linux_${ARCH}_Setup.zip \
-u "https://github.com/KangLin/RabbitRemoteControl/releases/download/v${{env.RabbitRemoteControl_VERSION}}/RabbitRemoteControl_${{env.RabbitRemoteControl_VERSION}}_Linux_${ARCH}_Setup.zip;https://master.dl.sourceforge.net/project/rabbitremotecontrol/v${{env.RabbitRemoteControl_VERSION}}/RabbitRemoteControl_${{env.RabbitRemoteControl_VERSION}}_Linux_${ARCH}_Setup.zip?viasf=1" \
--md5 "${MD5SUM}"
popd
popd
- name: Update artifact
#if: ${{matrix.variant.PACKAGE != 'deb'}}
uses: actions/upload-artifact@v4
with:
name: ${{ env.artifact_name }}_${{matrix.variant.PACKAGE}}_${{matrix.variant.image}}_${{matrix.variant.lable}}_${{matrix.variant.os}}
path: |
${{env.BUILD_DIR}}/build_linux/rabbitremotecontrol*.rpm
${{env.BUILD_DIR}}/build_linux/rabbitremotecontrol_*.deb
${{env.BUILD_DIR}}/build_linux/RabbitRemoteControl_*_Setup.zip
${{env.BUILD_DIR}}/build_linux/update_appimage_*.json