-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathTaskfile.yml
62 lines (53 loc) · 1.88 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
version: "3"
silent: true
tasks:
build:
cmds:
- swift build
format:
cmds:
- swift format --configuration .swift-format.json --recursive --in-place --parallel Sources/ Tests/ Examples/ Package.swift
lint:
cmds:
- cmd: swiftlint --quiet
ignore_error: true
- swift format lint --configuration .swift-format.json --recursive --parallel Sources/ Tests/ Examples/ Package.swift
package:
desc: "Build package"
cmds:
- swift build -c release
example:
desc: "Run example"
cmds:
- swift run {{.name}}Example
submodule:fetch:
desc: "Fetch a specific version of the submodule, or else the latest version. E.g. task submodule:fetch proto=vX.Y.Z"
dir: protobufs
vars:
latest_tag:
sh: >
git tag -l --sort=version:refname |
grep -v 'alpha\|beta\|rc' |
tail -1
proto: "{{.proto | default .latest_tag}}"
current_version:
sh: git describe --tags
cmds:
- echo "Protobuf version set to {{.proto}}"
- |
if [ "{{.current_version}}" = "{{.proto}}" ]; then
echo "Warning: Already at version {{.proto}}, skipping update"
exit 0
fi
- git fetch origin
- git checkout {{.proto}}
- git show-ref --verify -q refs/heads/{{.proto}} && git pull origin || exit 0
- cd ..
- task: submodule:generate
- task: build
- echo "Successfully updated protobufs to {{.proto}}"
submodule:generate:
desc: "Generate the swift files from the protobufs"
dir: Sources/HieroProtobufs
cmds:
- cmd: python3 update_protos.py