-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathTaskfile.yml
More file actions
70 lines (61 loc) · 1.64 KB
/
Taskfile.yml
File metadata and controls
70 lines (61 loc) · 1.64 KB
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
version: "3"
vars:
VERSION: 1.1.0
GENERATE_DIR: "cmd/generate"
DATASTAR_BRANCH: '{{.DATASTAR_BRANCH | default "repo-per-sdk"}}'
TEST_PORT: '{{.TEST_PORT | default "7331"}}'
tasks:
default:
cmds:
- task: generate
generate:
desc: Generate consts.go from SDK config
dir: cmd/generate
cmds:
- go run main.go
sources:
- main.go
generates:
- datastar/consts.go
libpub:
cmds:
- git push origin
- git tag v{{.VERSION}}
- git push --tags
- GOPROXY=proxy.golang.org go list -m github.com/starfederation/datastar-go@v{{.VERSION}}
test-server:
desc: Start test server on port {{.TEST_PORT}}
dir: cmd/testserver
cmds:
- go run main.go
sources:
- main.go
- ../../datastar/**/*.go
env:
TEST_PORT: "{{.TEST_PORT}}"
test-download:
desc: Download SDK test suite from GitHub
cmds:
- rm -rf tests
- mkdir -p tests
- |
curl -sL https://github.com/starfederation/datastar/archive/{{.DATASTAR_BRANCH}}.tar.gz | \
tar xz --strip-components=3 -C tests --wildcards 'datastar-*/sdk/tests/*'
test:
desc: Run SDK test suite
deps: [test-download]
cmds:
- cd tests && go run ./cmd/datastar-sdk-tests -server http://localhost:{{.TEST_PORT}}
hello:
desc: Run helloworld example
dir: cmd/examples/helloworld
cmds:
- go mod tidy
- go run .
hotreload:
desc: Run hotreload example
dir: cmd/examples/hotreload
cmds:
- go mod tidy
- go run generate-hotreload-html/main.go
- go tool reflex -r '^hotreload.html$' --start-service -- sh -c 'go run .'