mirror of
https://github.com/onyx-and-iris/xair-cli.git
synced 2026-02-26 00:09:11 +00:00
add separate taskfiles for x32,xair builds
This commit is contained in:
parent
ba0b0eaee2
commit
5aa833e2ca
23
Taskfile.build-x32.yml
Normal file
23
Taskfile.build-x32.yml
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
version: '3'
|
||||||
|
|
||||||
|
vars:
|
||||||
|
BIN_X32: x32-cli
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
windows-amd64:
|
||||||
|
desc: Build the x32-cli project for Windows
|
||||||
|
cmds:
|
||||||
|
- GOOS=windows GOARCH=amd64 go build -o {{.BIN_DIR}}/{{.BIN_X32}}_windows_amd64.exe -ldflags="-X main.version={{.VERSION}}" ./cmd/{{.BIN_X32}}
|
||||||
|
internal: true
|
||||||
|
|
||||||
|
linux-amd64:
|
||||||
|
desc: Build the x32-cli project for Linux
|
||||||
|
cmds:
|
||||||
|
- GOOS=linux GOARCH=amd64 go build -o {{.BIN_DIR}}/{{.BIN_X32}}_linux_amd64 -ldflags="-X main.version={{.VERSION}}" ./cmd/{{.BIN_X32}}
|
||||||
|
internal: true
|
||||||
|
|
||||||
|
darwin-amd64:
|
||||||
|
desc: Build the x32-cli project for macOS
|
||||||
|
cmds:
|
||||||
|
- GOOS=darwin GOARCH=amd64 go build -o {{.BIN_DIR}}/{{.BIN_X32}}_darwin_amd64 -ldflags="-X main.version={{.VERSION}}" ./cmd/{{.BIN_X32}}
|
||||||
|
internal: true
|
||||||
23
Taskfile.build-xair.yml
Normal file
23
Taskfile.build-xair.yml
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
version: '3'
|
||||||
|
|
||||||
|
vars:
|
||||||
|
BIN_XAIR: xair-cli
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
windows-amd64:
|
||||||
|
desc: Build the xair-cli project for Windows
|
||||||
|
cmds:
|
||||||
|
- GOOS=windows GOARCH=amd64 go build -o {{.BIN_DIR}}/{{.BIN_XAIR}}_windows_amd64.exe -ldflags="-X main.version={{.VERSION}}" ./cmd/{{.BIN_XAIR}}
|
||||||
|
internal: true
|
||||||
|
|
||||||
|
linux-amd64:
|
||||||
|
desc: Build the xair-cli project for Linux
|
||||||
|
cmds:
|
||||||
|
- GOOS=linux GOARCH=amd64 go build -o {{.BIN_DIR}}/{{.BIN_XAIR}}_linux_amd64 -ldflags="-X main.version={{.VERSION}}" ./cmd/{{.BIN_XAIR}}
|
||||||
|
internal: true
|
||||||
|
|
||||||
|
darwin-amd64:
|
||||||
|
desc: Build the xair-cli project for macOS
|
||||||
|
cmds:
|
||||||
|
- GOOS=darwin GOARCH=amd64 go build -o {{.BIN_DIR}}/{{.BIN_XAIR}}_darwin_amd64 -ldflags="-X main.version={{.VERSION}}" ./cmd/{{.BIN_XAIR}}
|
||||||
|
internal: true
|
||||||
41
Taskfile.yml
41
Taskfile.yml
@ -1,29 +1,32 @@
|
|||||||
version: '3'
|
version: '3'
|
||||||
|
|
||||||
|
includes:
|
||||||
|
build-xair: ./Taskfile.build-xair.yml
|
||||||
|
build-x32: ./Taskfile.build-x32.yml
|
||||||
|
|
||||||
vars:
|
vars:
|
||||||
PROGRAM: xair-cli
|
|
||||||
SHELL: '{{if eq .OS "Windows_NT"}}powershell{{end}}'
|
SHELL: '{{if eq .OS "Windows_NT"}}powershell{{end}}'
|
||||||
BIN_DIR: bin
|
BIN_DIR: bin
|
||||||
VERSION:
|
VERSION:
|
||||||
sh: 'git describe --tags $(git rev-list --tags --max-count=1)'
|
sh: 'git describe --tags $(git rev-list --tags --max-count=1)'
|
||||||
|
|
||||||
WINDOWS: '{{.BIN_DIR}}/{{.PROGRAM}}_windows_amd64.exe'
|
|
||||||
LINUX: '{{.BIN_DIR}}/{{.PROGRAM}}_linux_amd64'
|
|
||||||
MACOS: '{{.BIN_DIR}}/{{.PROGRAM}}_darwin_amd64'
|
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
default:
|
default:
|
||||||
desc: Build the xair-cli project
|
desc: Build the xair-cli and x32-cli projects for all platforms
|
||||||
cmds:
|
cmds:
|
||||||
- task: build
|
- task: build
|
||||||
|
|
||||||
build:
|
build:
|
||||||
desc: Build the xair-cli project
|
desc: Build the xair-cli and x32-cli projects for all platforms
|
||||||
deps: [vet]
|
deps: [vet]
|
||||||
cmds:
|
cmds:
|
||||||
- task: build-windows
|
- task: build-xair:windows-amd64
|
||||||
- task: build-linux
|
- task: build-xair:linux-amd64
|
||||||
- task: build-macos
|
- task: build-xair:darwin-amd64
|
||||||
|
|
||||||
|
- task: build-x32:windows-amd64
|
||||||
|
- task: build-x32:linux-amd64
|
||||||
|
- task: build-x32:darwin-amd64
|
||||||
|
|
||||||
vet:
|
vet:
|
||||||
desc: Vet the code
|
desc: Vet the code
|
||||||
@ -36,24 +39,6 @@ tasks:
|
|||||||
cmds:
|
cmds:
|
||||||
- go fmt ./...
|
- go fmt ./...
|
||||||
|
|
||||||
build-windows:
|
|
||||||
desc: Build the xair-cli project for Windows
|
|
||||||
cmds:
|
|
||||||
- GOOS=windows GOARCH=amd64 go build -o {{.WINDOWS}} -ldflags="-X main.version={{.VERSION}}"
|
|
||||||
internal: true
|
|
||||||
|
|
||||||
build-linux:
|
|
||||||
desc: Build the xair-cli project for Linux
|
|
||||||
cmds:
|
|
||||||
- GOOS=linux GOARCH=amd64 go build -o {{.LINUX}} -ldflags="-X main.version={{.VERSION}}"
|
|
||||||
internal: true
|
|
||||||
|
|
||||||
build-macos:
|
|
||||||
desc: Build the xair-cli project for macOS
|
|
||||||
cmds:
|
|
||||||
- GOOS=darwin GOARCH=amd64 go build -o {{.MACOS}} -ldflags="-X main.version={{.VERSION}}"
|
|
||||||
internal: true
|
|
||||||
|
|
||||||
test:
|
test:
|
||||||
desc: Run tests
|
desc: Run tests
|
||||||
cmds:
|
cmds:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user