This repository has been archived by the owner on Sep 13, 2024. It is now read-only.
forked from IchthysMaranatha/asterisk-chan-quectel
-
Notifications
You must be signed in to change notification settings - Fork 14
292 lines (282 loc) · 9.1 KB
/
publish.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
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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
#
# Building and bublishing packages: Debian and OpenWRT
#
name: Build packages
permissions:
contents: write
on:
push:
tags: v202*.*.*
workflow_dispatch:
env:
BUILD_TYPE: Release
OWRTVER: 23.05.3
UBUNTU_DISTRO: ubuntu22.04
jobs:
formatting-check:
name: Formatting Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: jidicula/[email protected]
with:
clang-format-version: 18
check-path: src
pre-build:
runs-on: ubuntu-latest
needs: formatting-check
steps:
- name: Checkout actions
uses: actions/checkout@v4
with:
sparse-checkout: .github/actions
sparse-checkout-cone-mode: false
- uses: ./.github/actions/install-required-packages
build-deb-pkg:
needs: pre-build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ./.github/actions/install-required-packages
- name: Install lintian
env:
DEBIAN_FRONTEND: noninteractive
run: sudo apt-get install -qq lintian
- name: Configure project
run: cmake -P make-build-dir.cmake
- name: Build packages
run: cmake -P make-package.cmake
- name: Check package
run: lintian --verbose --info package/asterisk-chan-quectel_*.deb
- name: Archive DEB
uses: actions/upload-artifact@v3
with:
name: pkg-deb
path: |
package/asterisk-chan-quectel_*.deb
package/asterisk-chan-quectel_*.deb.sha256
retention-days: 1
if-no-files-found: error
- name: Archive TAR.GZ
uses: actions/upload-artifact@v3
with:
name: pkg-tar-gz
path: |
package/asterisk-chan-quectel_*.tar.gz
package/asterisk-chan-quectel_*.tar.gz.sha256
retention-days: 1
if-no-files-found: error
deb-pkg-try-install:
needs: build-deb-pkg
env:
DEBIAN_FRONTEND: noninteractive
runs-on: ubuntu-latest
steps:
- name: Install gdebi package
run: sudo apt-get install -qq gdebi-core
- uses: actions/download-artifact@v3
with:
name: pkg-deb
path: deb
- name: Install package
working-directory: deb
run: |
for p in $(ls *.deb); do
echo "::notice::Installing package $p"
sudo gdebi --non-interactive $p || echo "::error::Could not install package $p"
done
build-deb-pkg-arch:
needs: pre-build
continue-on-error: true
strategy:
matrix:
arch: [armv7, aarch64]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ./.github/actions/install-required-packages
- uses: uraimo/run-on-arch-action@v2
name: Build package (${{ matrix.arch }})
with:
arch: ${{ matrix.arch }}
distro: ${{ env.UBUNTU_DISTRO }}
githubToken: ${{ github.token }}
install: |
apt-get update -qq -y
apt-get install -qq -y git cmake \
build-essential \
libsqlite3-dev libasound2-dev asterisk-dev
git config --global --add safe.directory /home/runner/work/asterisk-chan-quectel/asterisk-chan-quectel
env: |
DEBIAN_FRONTEND: noninteractive
run: |
cmake -P make-build-dir.cmake
cmake -P make-package.cmake
- name: Install lintian
env:
DEBIAN_FRONTEND: noninteractive
run: sudo apt-get install -qq -y lintian
- name: Check package
run: lintian --verbose --info package/asterisk-chan-quectel_*.deb
- name: Archive DEB
uses: actions/upload-artifact@v3
with:
name: pkg-deb-${{ matrix.arch }}
path: |
package/asterisk-chan-quectel_*.deb
package/asterisk-chan-quectel_*.deb.sha256
retention-days: 1
if-no-files-found: error
- name: Archive TAR.GZ
uses: actions/upload-artifact@v3
with:
name: pkg-tar-gz-${{ matrix.arch }}
path: |
package/asterisk-chan-quectel_*.tar.gz
package/asterisk-chan-quectel_*.tar.gz.sha256
retention-days: 1
if-no-files-found: error
- uses: uraimo/run-on-arch-action@v2
name: Try to instal package (${{ matrix.arch }})
with:
arch: ${{ matrix.arch }}
distro: ${{ env.UBUNTU_DISTRO }}
setup: |
mkdir -p "${PWD}/package"
dockerRunArgs: |
--volume "${PWD}/package:/package"
install: |
apt-get update -qq -y
apt-get install -qq -y gdebi-core
env: |
DEBIAN_FRONTEND: noninteractive
run: |
for p in $(ls package/*.deb); do
pn=$(basename $p)
echo "::notice::Installing package $pn"
gdebi --non-interactive $p || echo "::error::Could not install package $pn"
done
build-openwrt-pkg:
runs-on: ubuntu-latest
needs: pre-build
continue-on-error: true
strategy:
matrix:
include:
- target: x86-64
arch: x86_64
- target: x86-generic
arch: i386
cpu-type: pentium4
- target: ramips-mt7620
arch: mipsel
cpu-type: 24kc
- target: bcm47xx-generic
arch: mipsel
cpu-type: mips32
- target: bcm63xx-generic
arch: mips
cpu-type: mips32
- target: armsr-armv7
arch: armv7
cpu-type: cortex-a15
cpu-subtype: neon-vfpv4
eabi: true
- target: armsr-armv8
arch: aarch64
cpu-type: generic
- target: bcm27xx-bcm2708
arch: arm
cpu-type: arm1176jzf-s
cpu-subtype: vfp
eabi: true
- target: sunxi-cortexa7
arch: arm
cpu-type: cortex-a7
cpu-subtype: neon-vfpv4
eabi: true
- target: sunxi-cortexa8
arch: arm
cpu-type: cortex-a8
cpu-subtype: vfpv3
eabi: true
- target: sunxi-cortexa53
arch: aarch64
cpu-type: cortex-a53
- target: kirkwood-generic
arch: arm
cpu-type: xscale
eabi: true
steps:
- name: Checkout actions
uses: actions/checkout@v4
with:
sparse-checkout: |
.github/actions
sparse-checkout-cone-mode: false
- uses: ./.github/actions/install-required-packages
- uses: ./.github/actions/install-openwrt-sdk
with:
openwrt-version: ${{ env.OWRTVER }}
gcc-version: 12.3.0
target: ${{ matrix.target }}
arch: ${{ matrix.arch }}
eabi: ${{ matrix.eabi }}
- uses: actions/checkout@v4
with:
fetch-depth: 0
path: asterisk-modules/asterisk-chan-quectel
- name: Configure project
run: cmake -P asterisk-modules/asterisk-chan-quectel/configure-openwrt-makefile.cmake
- name: Generate OpenWRT Makefile
run: cmake -P asterisk-modules/asterisk-chan-quectel/install-openwrt-makefile.cmake
- name: Check OpenWRT SDK config file existience
id: check-owrt-cfg
uses: andstor/file-existence-action@v3
with:
files: "owrtsdk/${{ matrix.target }}/.config"
- name: Prepare OpenWRT SDK (symlink)
run: |
owrtsdk=$(cd owrtsdk; pwd)
cd asterisk-modules/asterisk-chan-quectel/install/openwrt
ln -sf ${owrtsdk}/${{ matrix.target }} ${{ matrix.target }}
- name: Prepare OpenWRT SDK (files)
if: steps.check-owrt-cfg.outputs.files_exists != 'true'
working-directory: asterisk-modules/asterisk-chan-quectel/install/openwrt
run: cp feeds-strskx.conf diffconfig build-opk.sh ${{ matrix.target }}
- name: Prepare OpenWRT SDK (feeds)
if: steps.check-owrt-cfg.outputs.files_exists == 'true'
working-directory: asterisk-modules/asterisk-chan-quectel/install/openwrt/${{ matrix.target }}
run: ./scripts/feeds install asterisk-chan-quectel
- name: Build OpenWRT packages
working-directory: asterisk-modules/asterisk-chan-quectel/install/openwrt/${{ matrix.target }}
run: ./build-opk.sh
- name: Archive IPK
uses: actions/upload-artifact@v3
with:
name: pkg-ipk-${{ format('{0}{1}{2}', matrix.arch, matrix.cpu-type && format('_{0}', matrix.cpu-type) || '', matrix.cpu-subtype && format('_{0}', matrix.cpu-subtype) || '') }}
path: asterisk-modules/asterisk-chan-quectel/install/openwrt/${{ matrix.target }}/bin/packages/*/strskx/*.ipk
retention-days: 1
if-no-files-found: error
publish:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
needs: [build-openwrt-pkg, deb-pkg-try-install, build-deb-pkg-arch]
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/download-artifact@v3
- name: Publish packages
uses: softprops/action-gh-release@v1
with:
draft: true
files: |
**/asterisk-chan-quectel*.tar.gz
**/asterisk-chan-quectel*.tar.gz.sha256
**/asterisk-chan-quectel*.deb
**/asterisk-chan-quectel*.deb.sha256
**/asterisk-chan-quectel*.ipk