forked from getsolus/packages
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yml
237 lines (210 loc) · 7.24 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
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
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
# 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-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 "=========================================================================="
build-local:
desc: "Build the current package against the unstable and the default local repo"
aliases: [local]
cmds:
- task: build
vars:
PROFILE: 'local-unstable-x86_64'
build-localindex:
desc: "Rebuild the local repo index if it exists."
aliases: [localindex]
cmds:
- |
[[ -d /var/lib/solbuild/local ]] && \
sudo eopkg index --skip-signing /var/lib/solbuild/local/ --output /var/lib/solbuild/local/eopkg-index.xml
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
vars:
PROFILE: 'local-unstable-x86_64'
- |
sudo cp -fv {{ .USER_WORKING_DIR }}/*.eopkg /var/lib/solbuild/local/
- task: build-localindex
# Modify package recipes
bump:
desc: Bump current release
dir: '{{ .USER_WORKING_DIR }}'
vars:
YBUMP: "/usr/share/ypkg/ybump.py"
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
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` ust exist in the current directory"
cmds:
- |
/usr/share/ypkg/yupdate.py {{ .CLI_ARGS }}
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"
# For staff and packagers with push access
publish:
desc: Tag and publish a release
dir: '{{ .USER_WORKING_DIR }}'
preconditions:
- sh: test $(git symbolic-ref HEAD 2>/dev/null) = "refs/heads/main"
msg: Not on main branch
- sh: "{{ .TASKFILE_DIR }}/common/Scripts/package-publish-safety-catches.sh"
msg: Failed to pass safety catches
deps:
- package-file
cmds:
- git push
- task: push
republish:
desc: Rebuild existing tag
dir: '{{ .USER_WORKING_DIR }}'
preconditions:
- sh: test $(git symbolic-ref HEAD 2>/dev/null) = "refs/heads/main"
msg: Not on main branch
- sh: "{{ .TASKFILE_DIR }}/common/Scripts/package-publish-safety-catches.sh"
msg: Failed to pass safety catches
cmds:
- task: push
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 }}"
cmds:
- ssh [email protected] build "{{ .SOURCE }}" "{{ .TAG }}" "{{ .PATH }}" "{{ .REF }}"
# 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 current tree
dir: '{{ .USER_WORKING_DIR }}'
cmds:
- rm *.eopkg -fv
clean-all:
desc: WARNING - Clean ALL eopkgs found in the monorepo
dir: '{{ .TASKFILE_DIR }}'
cmds:
- find $(git rev-parse --show-toplevel) -type f -name '*.eopkg' -delete
init:
desc: Initialize the packages repo
cmds:
- ln -sf ../../common/Hooks/pre-commit.py .git/hooks/pre-commit
- ln -sf ../../common/Hooks/prepare-commit-msg.py .git/hooks/prepare-commit-msg
- ln -sf ../../common/Hooks/post-merge.sh .git/hooks/post-merge
- ln -sf ../../common/Hooks/post-rewrite.sh .git/hooks/post-rewrite
pull:
desc: Pull/rebase latest changes
dir: '{{ .USER_WORKING_DIR }}'
preconditions:
- test -d .git
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}}