-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskfile.yml
134 lines (118 loc) · 2.37 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
version: "3"
tasks:
#
# sdk
#
sdk:build:
dir: sdk
deps:
- task: yarn:install
cmds:
- yarn build
sdk:test:
dir: sdk
cmds:
- yarn test
sdk:publish:
desc: Publish @useoptic/optic-node-sdk
dir: sdk
cmds:
- task: yarn:publish:guard
vars:
PROJECT_DIR: sdk
#
# express
#
express:build:
desc: Build the Extress middleware
dir: frameworks/express
deps:
- sdk:build
cmds:
- yarn build
express:test:
dir: frameworks/express
cmds:
- yarn test
express:publish:
desc: Publish @useoptic/express-middleware
dir: frameworks/express
cmds:
- task: yarn:publish:guard
vars:
PROJECT_DIR: frameworks/express
#
# hapi
#
hapi:build:
desc: Build the Extress middleware
dir: frameworks/hapi
deps:
- sdk:build
cmds:
- yarn build
hapi:test:
dir: frameworks/hapi
cmds:
- yarn test
hapi:publish:
desc: Publish @useoptic/hapi-middleware
dir: frameworks/hapi
cmds:
- task: yarn:publish:guard
vars:
PROJECT_DIR: frameworks/hapi
#
# utility stuff
#
yarn:install:
cmds:
- yarn install {{.CLI_ARGS}}
yarn:publish:
dir: "{{.PROJECT_DIR}}"
env:
NPM_AUTH_TOKEN: "{{.NPM_AUTH_TOKEN}}"
cmds:
- yarn publish --access=public --non-interactive
preconditions:
- sh: "[[ -n $NPM_AUTH_TOKEN ]]"
msg: "You must set NPM_AUTH_TOKEN"
yarn:publish:guard:
dir: "{{.PROJECT_DIR}}"
silent: true
env:
DRY_RUN: '{{default "true" .DRY_RUN}}'
cmds:
- |
if [ $DRY_RUN = true ]
then
echo "This will publish $(cat package.json | jq -r '. | .name + "@" + .version'). Set DRY_RUN=false to proceed."
exit 1
fi
- task: yarn:publish
vars:
PROJECT_DIR: "{{.PROJECT_DIR}}"
git:tag-and-push:
- git co main
- git pull --rebase
- git tag {{.CLI_ARGS}}
- git push origin main --tags
#
# composite tasks
#
build-all:
- task: sdk:build
- task: express:build
- task: hapi:build
test-all:
deps: [build-all]
cmds:
- task: sdk:test
- task: express:test
- task: hapi:test
publish-all:
deps: [build-all]
cmds:
- task: sdk:publish
- task: express:publish
- task: hapi:publish