Skip to content

Commit

Permalink
Merge pull request #331 from mritd/master
Browse files Browse the repository at this point in the history
chore(build): add taskfile
  • Loading branch information
tobyxdd authored May 17, 2022
2 parents eb7de74 + 119f2a8 commit 31d34e5
Showing 1 changed file with 156 additions and 0 deletions.
156 changes: 156 additions & 0 deletions Taskfile.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
version: '3'

tasks:
clean:
cmds:
- rm -rf dist
- mkdir -p dist
build-hysteria:
label: build-{{.TASK}}
vars:
BUILD_COMMIT:
sh: git rev-parse HEAD
BUILD_DATE:
sh: date "+%Y%m%d%H%M%S"
dir: ./cmd
cmds:
- |
GOOS={{.GOOS}} GOARCH={{.GOARCH}} GOARM={{.GOARM}} GOMIPS={{.GOMIPS}} \
go build -trimpath -o ../dist/hysteria-{{.TASK}} -ldflags \
"-w -s -X main.appCommit={{.BUILD_COMMIT}} -X main.appDate={{.BUILD_DATE}}"
linux-386:
cmds:
- task: build-hysteria
vars: {
TASK: "{{.TASK}}",
GOOS: linux,
GOARCH: 386
}
linux-amd64:
cmds:
- task: build-hysteria
vars: {
TASK: "{{.TASK}}",
GOOS: linux,
GOARCH: amd64
}
linux-amd64-v3:
cmds:
- task: build-hysteria
vars: {
TASK: "{{.TASK}}",
GOOS: linux,
GOARCH: amd64,
GOAMD64: v3
}
linux-armv5:
cmds:
- task: build-hysteria
vars: {
TASK: "{{.TASK}}",
GOOS: linux,
GOARCH: arm,
GOARM: 5
}
linux-armv6:
cmds:
- task: build-hysteria
vars: {
TASK: "{{.TASK}}",
GOOS: linux,
GOARCH: arm,
GOARM: 6
}
linux-armv7:
cmds:
- task: build-hysteria
vars: {
TASK: "{{.TASK}}",
GOOS: linux,
GOARCH: arm,
GOARM: 7
}
linux-armv8:
cmds:
- task: build-hysteria
vars: {
TASK: "{{.TASK}}",
GOOS: linux,
GOARCH: arm64
}
linux-mips-hardfloat:
cmds:
- task: build-hysteria
vars: {
TASK: "{{.TASK}}",
GOOS: linux,
GOARCH: mips,
GOMIPS: hardfloat
}
linux-mipsle-softfloat:
cmds:
- task: build-hysteria
vars: {
TASK: "{{.TASK}}",
GOOS: linux,
GOARCH: mipsle,
GOMIPS: softfloat
}
linux-mipsle-hardfloat:
cmds:
- task: build-hysteria
vars: {
TASK: "{{.TASK}}",
GOOS: linux,
GOARCH: mipsle,
GOMIPS: hardfloat
}
linux-mips64:
cmds:
- task: build-hysteria
vars: {
TASK: "{{.TASK}}",
GOOS: linux,
GOARCH: mips64
}
linux-mips64le:
cmds:
- task: build-hysteria
vars: {
TASK: "{{.TASK}}",
GOOS: linux,
GOARCH: mips64le
}
darwin-amd64:
cmds:
- task: build-hysteria
vars: {
TASK: "{{.TASK}}",
GOOS: darwin,
GOARCH: amd64
}
darwin-arm64:
cmds:
- task: build-hysteria
vars: {
TASK: "{{.TASK}}",
GOOS: darwin,
GOARCH: arm64
}
default:
cmds:
- task: clean
- task: linux-386
- task: linux-amd64
- task: linux-amd64-v3
- task: linux-armv5
- task: linux-armv6
- task: linux-armv7
- task: linux-armv8
- task: linux-mips-hardfloat
- task: linux-mipsle-softfloat
- task: linux-mipsle-hardfloat
- task: linux-mips64
- task: linux-mips64le
- task: darwin-amd64
- task: darwin-arm64

0 comments on commit 31d34e5

Please sign in to comment.