-
Notifications
You must be signed in to change notification settings - Fork 23
251 lines (202 loc) · 7.05 KB
/
linux.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
name: Linux
on:
push:
branches: [ master, develop ]
pull_request:
branches: [ master, develop ]
jobs:
shellcheck:
name: Shellcheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
env:
# SC1091: Ignore included files that cannot be found.
# SC2181: Ignore exit code style.
SHELLCHECK_OPTS: -e SC1091 -e SC2181
with:
ignore_paths: windows linux/templates linux/tests
build:
name: Build artifacts
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install nfpm@latest
run: curl -o /tmp/nfpm.tar.gz -sSL https://github.com/goreleaser/nfpm/releases/download/v2.7.1/nfpm_2.7.1_Linux_x86_64.tar.gz && cd /tmp && tar xf /tmp/nfpm.tar.gz && sudo mv nfpm /usr/local/bin && sudo chmod a+x /usr/local/bin/nfpm
- name: Install gomplate
run: sudo curl -o /usr/local/bin/gomplate -sSL https://github.com/hairyhenderson/gomplate/releases/download/v3.10.0/gomplate_linux-amd64 && sudo chmod +x /usr/local/bin/gomplate
- name: Build packages
run: make all
working-directory: linux
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: portmaster-current
path: linux/dist/*
- name: Build with next pkgrev
run: make clean && make increase-pkgrev && make all
working-directory: linux
- name: Upload artifacts with next pkgrev
uses: actions/upload-artifact@v2
with:
name: portmaster-next
path: linux/dist/*
test-shell-install:
name: Test curl|bash installer
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v2
with:
name: portmaster-current
path: linux
- name: Install tooling
run: sudo bash -c "apt-get update && apt-get install -y systemd desktop-file-utils"
env:
DEBIAN_FRONTEND: noninteractive
- name: Install dependencies
run: sudo apt-get install -y libnetfilter-queue1 ca-certificates
env:
DEBIAN_FRONTEND: noninteractive
- name: Install using SHELL installer
run: yes | sudo bash ./install.sh --assets-url file://$(echo $(pwd)/installer-assets-*.tar.gz)
working-directory: linux
- name: Verify installation
run: ./linux/tests/test-install.sh
- uses: actions/download-artifact@v2
with:
name: portmaster-next
path: linux/next
- name: "Upgrade to next pkgrev"
run: yes | sudo bash ./install.sh --assets-url file://$(echo $(pwd)/next/installer-assets-*.tar.gz)
working-directory: linux
- name: Verify upgrade
run: ./linux/tests/test-upgrade.sh
- name: Uninstall portmaster
run: yes | sudo bash ./install.sh --uninstall
working-directory: linux
- name: Verify uninstallation
run: ./linux/tests/test-uninstall.sh
test-ubuntu:
name: Test DEB package (ubuntu VM)
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/download-artifact@v2
with:
name: portmaster-current
path: linux
- name: Install tooling
run: sudo bash -c "apt-get update && apt-get install -y systemd desktop-file-utils"
env:
DEBIAN_FRONTEND: noninteractive
- name: Install dependencies
run: sudo apt-get install -y libnetfilter-queue1 ca-certificates
env:
DEBIAN_FRONTEND: noninteractive
- name: Install deb package
run: yes | sudo dpkg -i ./linux/portmaster_*.deb
- uses: actions/checkout@v2
- name: Verify installation
run: ./linux/tests/test-install.sh
- uses: actions/download-artifact@v2
with:
name: portmaster-next
path: linux/next
- name: "Upgrade to next pkgrev"
run: yes | sudo dpkg -i ./linux/next/portmaster_*.deb || ls -R
- name: Verify upgrade
run: ./linux/tests/test-upgrade.sh
- name: Uninstall portmaster
run: sudo apt-get remove -y portmaster
- name: Verify uninstallation
run: ./linux/tests/test-uninstall.sh
test-deb:
name: Test DEB package
runs-on: ubuntu-latest
strategy:
matrix:
container:
- hugojosefson/popos
- ubuntu:latest
- ubuntu:rolling
- ubuntu:xenial
- debian:stable
- debian:unstable
- debian:oldstable
- debian:testing
- linuxmintd/mint20-amd64
- linuxmintd/mint19-amd64
needs: build
steps:
- uses: actions/download-artifact@v2
with:
name: portmaster-current
path: linux
- name: Install tooling
run: sudo bash -c "apt-get update && apt-get install -y systemd desktop-file-utils"
env:
DEBIAN_FRONTEND: noninteractive
- name: Install dependencies
run: sudo apt-get install -y libnetfilter-queue1 ca-certificates
env:
DEBIAN_FRONTEND: noninteractive
- name: Install deb package
run: yes | sudo dpkg -i ./linux/portmaster_*.deb
- uses: actions/checkout@v2
- name: Verify installation
run: sudo ./linux/tests/test-install.sh
- uses: actions/download-artifact@v2
with:
name: portmaster-next
path: ./linux/next
- name: "Upgrade to next pkgrev"
run: yes | sudo dpkg -i ./linux/next/portmaster_*.deb
- name: Verify upgrade
run: ./linux/tests/test-upgrade.sh
- name: Uninstall portmaster
run: sudo apt-get remove -y portmaster
- name: Verify uninstallation
run: ./linux/tests/test-uninstall.sh
test-rpm:
name: Test RPM package
runs-on: ubuntu-latest
needs: build
strategy:
matrix:
container:
- fedora:32
- fedora:33
- fedora:34
# - centos:7
container: ${{ matrix.container }}
steps:
- uses: actions/download-artifact@v2
with:
name: portmaster-current
path: linux
- name: Install tooling
run: yum install -y systemd desktop-file-utils procps-ng
# we use yum localinstall instead of dnf install because
# not all tested distro versions have dnf available and those
# that have dnf have it aliased as yum.
- name: Install package
run: yum localinstall -y ./linux/portmaster-*.rpm
- uses: actions/checkout@v2
- name: Verify installation
run: ./linux/tests/test-install.sh
- uses: actions/download-artifact@v2
with:
name: portmaster-next
path: ./linux/next
- name: "Upgrade to next pkgrev"
run: yum localinstall -y ./linux/next/portmaster-*.rpm
- name: Verify upgrade
run: ./linux/tests/test-upgrade.sh
- name: Uninstall portmaster
run: yum remove -y portmaster
- name: Verify uninstallation
run: ./linux/tests/test-uninstall.sh