-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtaskfile.yml
73 lines (73 loc) · 1.74 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
version: '3'
dotenv: ['VERSION']
vars:
APP_NAME: "plan"
BIN_DIR: "$HOME/.local/bin"
RELEASE_DIR: ".build/release"
SWIFT_VERSION: "5.10"
tasks:
run:
cmds:
- swift run {{.APP_NAME}} next
silent: true
build:
cmds:
- swift build
silent: true
test:
cmds:
- swift test
silent: true
format:
cmds:
- swiftformat --swiftversion {{.SWIFT_VERSION}} Package.swift Sources Tests
silent: true
lint:
cmds:
- swiftlint
silent: true
artifacts:
deps: [test, lint]
env:
CURRENT_HASH:
sh: git rev-parse --short HEAD
cmds:
- sed -i '' "s/APP_VERSION/$APP_VERSION-$CURRENT_HASH/g" Sources/Version.swift
- swift build -Xswiftc -warnings-as-errors --configuration release --disable-sandbox --arch arm64
- git checkout Sources/Version.swift
silent: true
install:
requires:
vars: [APP_NAME, BIN_DIR]
deps: [artifacts]
cmds:
- mkdir -p "{{.BIN_DIR}}"
- cp "{{.RELEASE_DIR}}/{{.APP_NAME}}" "{{.BIN_DIR}}"
uninstall:
requires:
vars: [APP_NAME, BIN_DIR]
cmds:
- rm -rf "{{.BIN_DIR}}/{{.APP_NAME}}"
silent: true
tag:
deps: [artifacts]
cmds:
- git tag "$APP_VERSION"
- git push origin "$APP_VERSION"
release:
requires:
vars: [APP_NAME, RELEASE_DIR]
deps: [tag]
cmds:
- /opt/homebrew/bin/gh auth status
- cp {{.RELEASE_DIR}}/{{.APP_NAME}} {{.RELEASE_DIR}}/{{.APP_NAME}}-darwin-arm64
- /opt/homebrew/bin/gh release create --generate-notes "$APP_VERSION" {{.RELEASE_DIR}}/{{.APP_NAME}}-*
sha:
requires:
vars: [APP_NAME, RELEASE_DIR]
cmds:
- sha256sum {{.RELEASE_DIR}}/{{.APP_NAME}}-*
clean:
cmds:
- rm -rf .build
silent: true