-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathTaskfile.yml
64 lines (57 loc) · 3.12 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
# yaml-language-server: https://taskfile.dev/schema.json
# https://taskfile.dev
version: "3"
vars:
CMD_NAME: ipcmanview
PACKAGE_NAME: "github.com/ItsNotGoodName/ipcmanview"
tasks:
clean:
cmds:
- rm -rf dist
- mkdir dist dist/artifacts dist/files dist/files-windows
build-nightly:
internal: true
cmds:
- go generate ./...
- go mod tidy
- GOOS=linux GOARCH=amd64 go build -ldflags="{{.LDFLAGS}}" -o ./dist/{{.CMD_NAME}}_Linux_x86_64/{{.CMD_NAME}} {{.PACKAGE}}
- GOOS=linux GOARCH=arm GOARM=7 go build -ldflags="{{.LDFLAGS}}" -o ./dist/{{.CMD_NAME}}_Linux_armv7/{{.CMD_NAME}} {{.PACKAGE}}
- GOOS=linux GOARCH=arm64 go build -ldflags="{{.LDFLAGS}}" -o ./dist/{{.CMD_NAME}}_Linux_arm64/{{.CMD_NAME}} {{.PACKAGE}}
- GOOS=darwin GOARCH=arm64 go build -ldflags="{{.LDFLAGS}}" -o ./dist/{{.CMD_NAME}}_Darwin_arm64/{{.CMD_NAME}} {{.PACKAGE}}
- GOOS=windows GOARCH=amd64 go build -ldflags="{{.LDFLAGS}}" -o ./dist/{{.CMD_NAME}}_Windows_x86_64/{{.CMD_NAME}}.exe {{.PACKAGE}}
- mkdir -p ./dist/linux && ln -rsf ./dist/ipcmanview_Linux_x86_64 ./dist/linux/amd64
- mkdir -p ./dist/linux/arm && ln -rsf ./dist/ipcmanview_Linux_armv7 ./dist/linux/arm/v7
- mkdir -p ./dist/linux && ln -rsf ./dist/ipcmanview_Linux_arm64 ./dist/linux/arm64
env:
CGO_ENABLED: 0
vars:
BUILD_PACKAGE_NAME: "{{.PACKAGE_NAME}}/internal/build"
BUILD_VERSION: "nightly"
BUILD_DATE: '{{now | date "2006-01-02T15:04:05Z07:00"}}'
BUILD_COMMIT:
sh: git rev-parse HEAD
BUILD_REPO_URL: "https://{{.PACKAGE_NAME}}"
LDFLAGS: -s -w -X {{.BUILD_PACKAGE_NAME}}.version={{.BUILD_VERSION}} -X {{.BUILD_PACKAGE_NAME}}.commit={{.BUILD_COMMIT}} -X {{.BUILD_PACKAGE_NAME}}.date={{.BUILD_DATE}} -X {{.BUILD_PACKAGE_NAME}}.repoURL={{.BUILD_REPO_URL}}
PACKAGE: "{{.PACKAGE_NAME}}/cmd/{{.CMD_NAME}}"
compile-artifacts:
internal: true
dir: dist
cmds:
- for: { var: FILES }
cmd: cp ../{{.ITEM}} "./files/$(basename {{.ITEM}})"
- for: { var: WINDOWS_FILES }
cmd: cp ../{{.ITEM}} "./files-windows/$(basename {{.ITEM}})"
- cd {{.CMD_NAME}}_Linux_x86_64 && cp ../files/* . && tar -czf ../artifacts/{{.CMD_NAME}}_Linux_x86_64.tar.gz *
- cd {{.CMD_NAME}}_Linux_armv7 && cp ../files/* . && tar -czf ../artifacts/{{.CMD_NAME}}_Linux_armv7.tar.gz *
- cd {{.CMD_NAME}}_Linux_arm64 && cp ../files/* . && tar -czf ../artifacts/{{.CMD_NAME}}_Linux_arm64.tar.gz *
- cd {{.CMD_NAME}}_Darwin_arm64 && cp ../files/* . && tar -czf ../artifacts/{{.CMD_NAME}}_Darwin_arm64.tar.gz *
- cd {{.CMD_NAME}}_Windows_x86_64 && cp ../files/* . && cp ../files-windows/* . && zip -q ../artifacts/{{.CMD_NAME}}_Windows_x86_64.zip *
- cd artifacts && sha256sum *.tar.gz *.zip > checksum.txt
vars:
FILES: README.md LICENSE
WINDOWS_FILES: assets/start.bat
nightly:
deps: [clean]
cmds:
- task: build-nightly
- task: compile-artifacts