forked from getsolus/packages
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yml
305 lines (271 loc) · 10.4 KB
/
Taskfile.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
293
294
295
296
297
298
299
300
301
302
303
304
305
version : '3'
set: [pipefail]
vars:
SPECFILE:
sh: if [ -f "{{ .USER_WORKING_DIR }}/package.yml" ]; then echo "package.yml"; else echo "pspec.xml"; fi;
PSPECFILE:
sh: if [ -f "{{ .USER_WORKING_DIR }}/package.yml" ]; then echo "pspec_x86_64.xml"; else echo "pspec.xml"; fi;
includes:
qt5:
taskfile: ./common/Tasks/Taskfile.qt5.yml
infra:
dir: ../infrastructure-tooling
taskfile: ../infrastructure-tooling/Infra.yml
optional: true
tasks:
# Ensure people new to go-task and used to 'make help' have an easier time
help:
desc: Show how to list available tasks
silent: true
cmds:
- echo "Use 'go-task -l/--list' to list available tasks."
# Utility tasks, mainly for precondition checks
package-file:
internal: true
desc: >-
Check that either `package.yml` or `pspec.xml` exists in the current directory
dir: '{{ .USER_WORKING_DIR }}'
requires:
vars: [SPECFILE]
preconditions:
- sh: test -f package.yml || test -f pspec.xml
msg: Either `package.yml` or `pspec.xml` must exists in the current directory
solbuild-reset:
desc: >-
Delete all existing solbuild cache and images, then download fresh solbuild images + cache updates
cmds:
- sudo solbuild delete-cache --all --images
- sudo solbuild init --update --profile unstable-x86_64
- sudo solbuild init --update --profile main-x86_64
# Build packages
build:
desc: Build the current package against the unstable repo
aliases: [default]
dir: '{{ .USER_WORKING_DIR }}'
vars:
PROFILE: '{{ default "unstable-x86_64" .PROFILE }}'
deps:
- package-file
cmds:
- sudo solbuild build {{ .SPECFILE }} -p {{ .PROFILE }} {{ .CLI_ARGS }}
build-local:
desc: "Build the current package against the unstable and the default local repo"
aliases: [local]
cmds:
# Ensure that we're always building against a fresh local repo index
- task: build-localindex
- task: build
vars:
PROFILE: 'local-unstable-x86_64'
build-localcp:
desc: "Build the current package against the unstable and the default local repo and forcibly copy .eopkgs to the default local repo."
aliases: [localcp]
cmds:
- task: build-local
- sudo cp -fv {{ .USER_WORKING_DIR }}/*.eopkg /var/lib/solbuild/local/
# Ensure that the freshly built package is picked up by the local repo index
- task: build-localindex
build-localindex:
desc: "Rebuild the local repo index if it exists."
aliases: [localindex]
cmds:
- |
[[ -d /var/lib/solbuild/local ]] && \
sudo eopkg.bin index --skip-signing /var/lib/solbuild/local/ --output /var/lib/solbuild/local/eopkg-index.xml && \
sudo eopkg.bin ur # Force eopkg to pick up the new index
build-stable:
desc: Build the current package against the stable repo (do NOT use for official submissions!)
aliases: [stable]
cmds:
- task: build
vars:
PROFILE: 'main-x86_64'
- |
echo "=========================================================================="
echo "WARNING: This package was built against -stable and is for local use only."
echo " "
echo " Do NOT publish packages or Pull Requests built against -stable!!!"
echo "=========================================================================="
# Modify package recipes
bump:
desc: Bump current release
dir: '{{ .USER_WORKING_DIR }}'
vars:
YBUMP: "ybump"
PBUMP: "{{ .TASKFILE_DIR }}/common/Scripts/pbump.py"
BUMP_SCRIPT: '{{ eq .SPECFILE "package.yml" | ternary .YBUMP .PBUMP }}'
deps:
- package-file
cmds:
- "{{ .BUMP_SCRIPT }} {{ .SPECFILE }}"
convert:
desc: Convert pspec to package.yml
dir: '{{ .USER_WORKING_DIR }}'
preconditions:
- sh: test -f pspec.xml
msg: "`pspec.xml` must exist in the current directory to perform conversion"
cmds:
- '{{ .TASKFILE_DIR }}/common/Scripts/yconvert.py pspec.xml'
cvecheck:
desc: Check package for CVEs
dir: '{{ .USER_WORKING_DIR }}'
cmds:
- 'cve-check-tool {{ .PSPECFILE }} -M {{ .TASKFILE_DIR }}/common/mapping -o report.html'
notify-complete:
desc: Get a notification when the build has finished on the buildserver
dir: '{{ .USER_WORKING_DIR }}'
deps:
- package-file
cmds:
- "{{ .TASKFILE_DIR }}/common/Scripts/buildserver-notification.sh"
pkgconfig:
desc: >-
Find which package provides a given pkgconfig target.
Example usage: `go-task pkgconfig -- Qt5Core Qt6Core`
cmds:
- '{{ .TASKFILE_DIR }}/common/Scripts/epcsearch.py {{ .CLI_ARGS }}'
update:
desc: >-
Update an existing package.yml recipe to a new version given a version and a download URI.
Example usage: `go-task update -- 7.2 https://www.nano-editor.org/dist/v7/nano-7.2.tar.xz`
dir: '{{ .USER_WORKING_DIR }}'
preconditions:
- sh: test -f package.yml
msg: "`package.yml` must exist in the current directory"
cmds:
- 'yupdate {{ .CLI_ARGS }}'
# For staff and packagers with push access
publish:
desc: >-
Publish the last commit for the current package to the repository and the build server.
The `run-safety-catches` task is used to check for common issues before pushing.
dir: '{{ .USER_WORKING_DIR }}'
preconditions:
- sh: test $(git symbolic-ref HEAD 2>/dev/null) = "refs/heads/main"
msg: Not on main branch
deps:
- package-file
cmds:
- task: run-safety-catches
- git push
- task: push
republish:
desc: >-
Retry the last commit for the current package on the build server.
The `run-safety-catches` task is used to check for common issues before pushing.
dir: '{{ .USER_WORKING_DIR }}'
preconditions:
- sh: test $(git symbolic-ref HEAD 2>/dev/null) = "refs/heads/main"
msg: Not on main branch
cmds:
- task: run-safety-catches
- task: push
run-safety-catches:
desc: Check for issues in the currently staged commits using the CI package checks.
dir: '{{ .USER_WORKING_DIR }}'
cmds:
- "{{ .TASKFILE_DIR }}/common/Scripts/package-publish-safety-catches.sh"
push:
desc: Push package to the build server
internal: true
dir: '{{ .USER_WORKING_DIR }}'
vars:
SOURCE:
sh: basename '{{ .USER_WORKING_DIR }}'
TAG:
sh: if [ -f {{ .SPECFILE }} ]; then {{ .TASKFILE_DIR }}/common/Scripts/gettag.py {{ .USER_WORKING_DIR }}/{{ .SPECFILE }}; fi
PATH:
sh: git rev-parse --show-prefix
REF:
sh: git rev-list -1 HEAD "{{ .USER_WORKING_DIR }}"
PUBLISH_COMMENT: '{{ .PUBLISH_COMMENT | default "" | b64enc }}'
cmds:
- ssh [email protected] build "{{ .SOURCE }}" "{{ .TAG }}" "{{ .PATH }}" "{{ .REF }}" "{{ .PUBLISH_COMMENT }}"
# Other utilities
check:
desc: Run package sanity checks
dir: '{{ .USER_WORKING_DIR }}'
cmds:
- "{{ .TASKFILE_DIR }}/common/CI/package_checks.py --modified --untracked --base origin/main {{.CLI_ARGS}}"
clean:
desc: Clean .eopkgs found in the current directory
dir: '{{ .USER_WORKING_DIR }}'
cmds:
- rm *.eopkg -fv
clean-local:
desc: WARNING - Clean ALL eopkgs found in solbuild local repository /var/lib/solbuild/local
aliases: [rmlocal, rml]
cmds:
- task: list-local # first show all found .eopkg files
- task: delete-local # then prompt before deleting them
- task: build-localindex # ... and rebuild the index afterwards
delete-local:
desc: Ask before deleting all .eopkgs found in the local repo
dir: '{{ .TASKFILE_DIR }}'
prompt: This will delete ALL .eopkgs found in the solbuild local repository. Continue?
cmds:
- sudo rm /var/lib/solbuild/local/*.eopkg
list-local:
desc: List all .eopkgs in the local repo (/var/lib/solbuild/local/*.eopkg)
aliases: [lslocal, lsl]
cmds:
- ls -AFcghlot /var/lib/solbuild/local/
clean-all:
desc: List all .eopkgs found in the monorepo, ask before deleting them.
aliases: [rmall, rma]
cmds:
- task: list-all-eopkgs # first show all found .eopkg files
- task: delete-all-eopkgs # then prompt before deleting them
delete-all-eopkgs:
desc: Ask before deleting all .eopkgs found in the monorepo.
dir: '{{ .TASKFILE_DIR }}'
prompt: This will delete ALL .eopkgs found in the monorepo. Do you wish to continue?
cmds:
- find $(git rev-parse --show-toplevel) -type f -name '*.eopkg' -delete
list-all-eopkgs:
desc: List all .eopkgs found in the monorepo
aliases: [lsall, lsa]
dir: '{{ .TASKFILE_DIR }}'
cmds:
- find $(git rev-parse --show-toplevel) -type f -name '*.eopkg' -print
init:
desc: Initialize the packages repo
cmds:
- ln -sf ../../common/Hooks/pre-commit.py $(git rev-parse --git-path hooks)/pre-commit
- ln -sf ../../common/Hooks/prepare-commit-msg.py $(git rev-parse --git-path hooks)/prepare-commit-msg
- ln -sf ../../common/Hooks/post-merge.sh $(git rev-parse --git-path hooks)/post-merge
- ln -sf ../../common/Hooks/post-rewrite.sh $(git rev-parse --git-path hooks)/post-rewrite
pull:
desc: Pull/rebase latest changes
dir: '{{ .USER_WORKING_DIR }}'
preconditions:
- git rev-parse --is-inside-work-tree
cmds:
- git pull --rebase
new:
desc: Create a new package
dir: '{{ .USER_WORKING_DIR }}'
vars:
NEWPKG: "{{ .TASKFILE_DIR }}/common/Scripts/new-package.sh"
cmds:
- '{{ .NEWPKG }} {{.CLI_ARGS}}'
check-appstream-progress:
desc: Generate a progress report detailing which packages still need appstream metadata added
dir: '{{ .TASKFILE_DIR }}'
cmds:
- common/Scripts/check_appstream_progress.py packages
add-monitoring:
desc: Add skeleton for monitoring.yml
dir: '{{ .USER_WORKING_DIR }}'
vars:
DATE:
sh: date -u +%Y-%m-%d
COMMENT: "# No known CPE, checked {{ .DATE }}"
cmds:
- touch monitoring.yml
- yq --inplace '
.releases.id line_comment = "# Check https://release-monitoring.org/" |
.releases.rss line_comment = "# For example https://github.com/PyO3/maturin/releases.atom" |
(.security | key) head_comment = "{{ .COMMENT }}" |
.security.cpe = ~
' monitoring.yml