############################################################################## # # # go-task: https://taskfile.dev/installation/ # # # # For the role of 'amd64-v*', please refer to # # https://en.wikipedia.org/wiki/X86-64#Microarchitecture_levels. # # # ############################################################################## version: '3' vars: BUILD_VERSION: sh: git describe --tags --always --match 'v*' BUILD_COMMIT: sh: git rev-parse HEAD BUILD_DATE: sh: date -u '+%F %T' tasks: clean: cmds: - rm -rf dist - mkdir -p dist hash: dir: ./dist cmds: - sha256sum hysteria-* > hashes.txt build-hysteria: label: build-{{.TASK}} dir: ./app/cmd cmds: - | GOOS={{.GOOS}} GOARCH={{.GOARCH}} GOARM={{.GOARM}} GOAMD64={{.GOAMD64}} GOMIPS={{.GOMIPS}} \ go build -trimpath -o ../../dist/hysteria-{{.TASK}}{{.BINEXT}} -ldflags \ "-w -s -X 'main.appVersion={{.BUILD_VERSION}}' -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-v2: cmds: - task: build-hysteria vars: { TASK: "{{.TASK}}", GOOS: linux, GOARCH: amd64, GOAMD64: v2 } linux-amd64-v3: cmds: - task: build-hysteria vars: { TASK: "{{.TASK}}", GOOS: linux, GOARCH: amd64, GOAMD64: v3 } linux-amd64-v4: cmds: - task: build-hysteria vars: { TASK: "{{.TASK}}", GOOS: linux, GOARCH: amd64, GOAMD64: v4 } 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-s390x: cmds: - task: build-hysteria vars: { TASK: "{{.TASK}}", GOOS: linux, GOARCH: s390x } 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-amd64-v2: cmds: - task: build-hysteria vars: { TASK: "{{.TASK}}", GOOS: darwin, GOARCH: amd64, GOAMD64: v2 } darwin-amd64-v3: cmds: - task: build-hysteria vars: { TASK: "{{.TASK}}", GOOS: darwin, GOARCH: amd64, GOAMD64: v3 } darwin-amd64-v4: cmds: - task: build-hysteria vars: { TASK: "{{.TASK}}", GOOS: darwin, GOARCH: amd64, GOAMD64: v4 } darwin-arm64: cmds: - task: build-hysteria vars: { TASK: "{{.TASK}}", GOOS: darwin, GOARCH: arm64 } freebsd-386: cmds: - task: build-hysteria vars: { TASK: "{{.TASK}}", GOOS: freebsd, GOARCH: 386 } freebsd-amd64: cmds: - task: build-hysteria vars: { TASK: "{{.TASK}}", GOOS: freebsd, GOARCH: amd64 } freebsd-amd64-v2: cmds: - task: build-hysteria vars: { TASK: "{{.TASK}}", GOOS: freebsd, GOARCH: amd64, GOAMD64: v2 } freebsd-amd64-v3: cmds: - task: build-hysteria vars: { TASK: "{{.TASK}}", GOOS: freebsd, GOARCH: amd64, GOAMD64: v3 } freebsd-amd64-v4: cmds: - task: build-hysteria vars: { TASK: "{{.TASK}}", GOOS: freebsd, GOARCH: amd64, GOAMD64: v4 } freebsd-arm: cmds: - task: build-hysteria vars: { TASK: "{{.TASK}}", GOOS: freebsd, GOARCH: arm } freebsd-arm64: cmds: - task: build-hysteria vars: { TASK: "{{.TASK}}", GOOS: freebsd, GOARCH: arm64 } windows-386: cmds: - task: build-hysteria vars: { TASK: "{{.TASK}}", BINEXT: ".exe", GOOS: windows, GOARCH: 386 } windows-amd64: cmds: - task: build-hysteria vars: { TASK: "{{.TASK}}", BINEXT: ".exe", GOOS: windows, GOARCH: amd64 } windows-amd64-v2: cmds: - task: build-hysteria vars: { TASK: "{{.TASK}}", BINEXT: ".exe", GOOS: windows, GOARCH: amd64, GOAMD64: v2 } windows-amd64-v3: cmds: - task: build-hysteria vars: { TASK: "{{.TASK}}", BINEXT: ".exe", GOOS: windows, GOARCH: amd64, GOAMD64: v3 } windows-amd64-v4: cmds: - task: build-hysteria vars: { TASK: "{{.TASK}}", BINEXT: ".exe", GOOS: windows, GOARCH: amd64, GOAMD64: v4 } windows-arm64: cmds: - task: build-hysteria vars: { TASK: "{{.TASK}}", BINEXT: ".exe", GOOS: windows, GOARCH: arm64 } default: cmds: - task: clean - task: linux-386 - task: linux-amd64 - task: linux-amd64-v2 - task: linux-amd64-v3 - task: linux-amd64-v4 - task: linux-armv5 - task: linux-armv6 - task: linux-armv7 - task: linux-armv8 - task: linux-s390x - task: linux-mips-hardfloat - task: linux-mipsle-softfloat - task: linux-mipsle-hardfloat - task: linux-mips64 - task: linux-mips64le - task: darwin-amd64 - task: darwin-amd64-v2 - task: darwin-amd64-v3 - task: darwin-amd64-v4 - task: darwin-arm64 - task: freebsd-386 - task: freebsd-amd64 - task: freebsd-amd64-v2 - task: freebsd-amd64-v3 - task: freebsd-amd64-v4 - task: freebsd-arm - task: freebsd-arm64 - task: windows-386 - task: windows-amd64 - task: windows-amd64-v2 - task: windows-amd64-v3 - task: windows-amd64-v4 - task: windows-arm64 - task: hash