-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathTaskfile.yml
More file actions
47 lines (44 loc) · 1.37 KB
/
Taskfile.yml
File metadata and controls
47 lines (44 loc) · 1.37 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
# https://taskfile.dev
version: '2'
vars:
APPLICATION_NAME: osc-utility
MAIN_FILE: "main.go"
tasks:
commit:
desc: Run before committing to github.
cmds:
- gofmt -s -w .
build:
desc: Build the binaries for multiple architectures.
deps:
- commit
- build-folder
cmds:
- task: build-platform
vars: {GOOS: "darwin", GOARCH: "amd64"}
- task: build-platform
vars: {GOOS: "linux", GOARCH: "amd64"}
- task: build-platform
vars: {GOOS: "linux", GOARCH: "386"}
- task: build-platform
vars: {GOOS: "linux", GOARCH: "arm"}
- task: build-platform
vars: {GOOS: "linux", GOARCH: "arm64"}
- task: build-platform
vars: {GOOS: "windows", GOARCH: "amd64"}
- task: build-platform
vars: {GOOS: "windows", GOARCH: "386"}
silent: true
build-folder:
desc: Create the output folder for the build.
cmds:
- mkdir build
generates:
- build/*
build-platform:
summary: Build the binary for a given platform.
cmds:
- go build -o build/{{.APPLICATION_NAME}}_{{.GOOS}}_{{.GOARCH}} {{.MAIN_FILE}}
env:
GOOS: "{{.GOOS}}"
GOARCH: "{{.GOARCH}}"