Merge pull request #531 from mritd/master

chore(go-task): supported amd64-v* & s390x
This commit is contained in:
mritd 2022-12-12 12:19:58 +08:00 committed by GitHub
commit 042f42b655
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,5 +1,22 @@
##############################################################################
# #
# 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' 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: tasks:
clean: clean:
cmds: cmds:
@ -11,18 +28,11 @@ tasks:
- sha256sum hysteria-* > hashes.txt - sha256sum hysteria-* > hashes.txt
build-hysteria: build-hysteria:
label: build-{{.TASK}} label: build-{{.TASK}}
vars: dir: ./app/cmd
BUILD_VERSION:
sh: git describe --tags --always --match 'v*'
BUILD_COMMIT:
sh: git rev-parse HEAD
BUILD_DATE:
sh: date -u '+%F %T'
dir: ./app/cmd/
cmds: cmds:
- | - |
GOOS={{.GOOS}} GOARCH={{.GOARCH}} GOARM={{.GOARM}} GOAMD64={{.GOAMD64}} GOMIPS={{.GOMIPS}} \ GOOS={{.GOOS}} GOARCH={{.GOARCH}} GOARM={{.GOARM}} GOAMD64={{.GOAMD64}} GOMIPS={{.GOMIPS}} \
go build -trimpath -o ../../dist/hysteria-{{.TASK}} -ldflags \ 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}}'" "-w -s -X 'main.appVersion={{.BUILD_VERSION}}' -X 'main.appCommit={{.BUILD_COMMIT}}' -X 'main.appDate={{.BUILD_DATE}}'"
linux-386: linux-386:
cmds: cmds:
@ -40,6 +50,24 @@ tasks:
GOOS: linux, GOOS: linux,
GOARCH: amd64 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: linux-amd64-v4:
cmds: cmds:
- task: build-hysteria - task: build-hysteria
@ -84,6 +112,14 @@ tasks:
GOOS: linux, GOOS: linux,
GOARCH: arm64 GOARCH: arm64
} }
linux-s390x:
cmds:
- task: build-hysteria
vars: {
TASK: "{{.TASK}}",
GOOS: linux,
GOARCH: s390x
}
linux-mips-hardfloat: linux-mips-hardfloat:
cmds: cmds:
- task: build-hysteria - task: build-hysteria
@ -135,6 +171,24 @@ tasks:
GOOS: darwin, GOOS: darwin,
GOARCH: amd64 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: darwin-amd64-v4:
cmds: cmds:
- task: build-hysteria - task: build-hysteria
@ -168,6 +222,24 @@ tasks:
GOOS: freebsd, GOOS: freebsd,
GOARCH: amd64 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: freebsd-amd64-v4:
cmds: cmds:
- task: build-hysteria - task: build-hysteria
@ -197,7 +269,8 @@ tasks:
cmds: cmds:
- task: build-hysteria - task: build-hysteria
vars: { vars: {
TASK: "{{.TASK}}.exe", TASK: "{{.TASK}}",
BINEXT: ".exe",
GOOS: windows, GOOS: windows,
GOARCH: 386 GOARCH: 386
} }
@ -205,15 +278,37 @@ tasks:
cmds: cmds:
- task: build-hysteria - task: build-hysteria
vars: { vars: {
TASK: "{{.TASK}}.exe", TASK: "{{.TASK}}",
BINEXT: ".exe",
GOOS: windows, GOOS: windows,
GOARCH: amd64 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: windows-amd64-v4:
cmds: cmds:
- task: build-hysteria - task: build-hysteria
vars: { vars: {
TASK: "{{.TASK}}.exe", TASK: "{{.TASK}}",
BINEXT: ".exe",
GOOS: windows, GOOS: windows,
GOARCH: amd64, GOARCH: amd64,
GOAMD64: v4 GOAMD64: v4
@ -222,7 +317,8 @@ tasks:
cmds: cmds:
- task: build-hysteria - task: build-hysteria
vars: { vars: {
TASK: "{{.TASK}}.exe", TASK: "{{.TASK}}",
BINEXT: ".exe",
GOOS: windows, GOOS: windows,
GOARCH: arm64 GOARCH: arm64
} }
@ -231,26 +327,35 @@ tasks:
- task: clean - task: clean
- task: linux-386 - task: linux-386
- task: linux-amd64 - task: linux-amd64
- task: linux-amd64-v2
- task: linux-amd64-v3
- task: linux-amd64-v4 - task: linux-amd64-v4
- task: linux-armv5 - task: linux-armv5
- task: linux-armv6 - task: linux-armv6
- task: linux-armv7 - task: linux-armv7
- task: linux-armv8 - task: linux-armv8
- task: linux-s390x
- task: linux-mips-hardfloat - task: linux-mips-hardfloat
- task: linux-mipsle-softfloat - task: linux-mipsle-softfloat
- task: linux-mipsle-hardfloat - task: linux-mipsle-hardfloat
- task: linux-mips64 - task: linux-mips64
- task: linux-mips64le - task: linux-mips64le
- task: darwin-amd64 - task: darwin-amd64
- task: darwin-amd64-v2
- task: darwin-amd64-v3
- task: darwin-amd64-v4 - task: darwin-amd64-v4
- task: darwin-arm64 - task: darwin-arm64
- task: freebsd-386 - task: freebsd-386
- task: freebsd-amd64 - task: freebsd-amd64
- task: freebsd-amd64-v2
- task: freebsd-amd64-v3
- task: freebsd-amd64-v4 - task: freebsd-amd64-v4
- task: freebsd-arm - task: freebsd-arm
- task: freebsd-arm64 - task: freebsd-arm64
- task: windows-386 - task: windows-386
- task: windows-amd64 - task: windows-amd64
- task: windows-amd64-v2
- task: windows-amd64-v3
- task: windows-amd64-v4 - task: windows-amd64-v4
- task: windows-arm64 - task: windows-arm64
- task: hash - task: hash