# https://taskfile.dev version: '3' # Variables vars: ## Commands Go ## GOCMD: go GOBUILD: "{{.GOCMD}} build -o" GORUN: "{{.GOCMD}} run" GOTEST: "{{.GOCMD}} test -v" GOCOVER: "{{.GOCMD}} test -v --cover" # Variables to get version VERSION: sh: cd version/ && versionManager go version ## Binary name ## WINDOWS_BINARY_NAME: ./release/windows/{{.VERSION}}/kode-starter.exe LINUX_BINARY_NAME: ./release/linux/{{.VERSION}}/kode-starter # faire un build pour Windows sur linux il faut installer mingw-w64 # sudo apt-get install mingw-w64 env: GOOS: windows GOARCH: amd64 tasks: ###### LINUX ###### ## Make sure you have PATH the versionManager !!! linux-version: cmds: - "cd ./version/ && versionManager go build" # silent: true ## Build ## linux-build: cmds: - "{{.GOBUILD}} {{.LINUX_BINARY_NAME}} -v" # silent: true ## change Build version and build linux-vbuild: cmds: - task: linux-version - task: linux-build ###### WINDOWS ###### ## Make sure you have PATH the versionManager.exe !!! windows-version: cmds: - "cd ./version/ && versionManager.exe go build" # silent: true windows-build: cmds: - "{{.GOBUILD}} {{.WINDOWS_BINARY_NAME}} -v" # silent: true ## change Build version and build windows-vbuild: cmds: - task: windows-version - task: windows-build