go-KodeStarter/Taskfile.yml

127 lines
3.0 KiB
YAML
Raw Permalink Normal View History

2023-06-24 02:00:53 -04:00
# https://taskfile.dev
version: '3'
2023-07-01 00:49:45 -04:00
#### Variables ####
# # # # # # # # # #
2023-06-24 02:00:53 -04:00
vars:
2023-07-01 00:49:45 -04:00
#### Commands Go ####
2023-06-24 02:00:53 -04:00
GOCMD: go
GOBUILD: "{{.GOCMD}} build -o"
GORUN: "{{.GOCMD}} run"
GOTEST: "{{.GOCMD}} test -v"
GOCOVER: "{{.GOCMD}} test -v --cover"
2023-06-30 14:17:21 -04:00
2023-07-01 00:49:45 -04:00
#### Variables to get version ####
2023-06-30 10:09:01 -04:00
VERSION:
sh: cd version/ && versionManager go version
2023-06-24 02:00:53 -04:00
2023-07-01 00:49:45 -04:00
#### Variable HOME of user ####
HOME:
sh: echo $HOME
#### Binary name of kode-creator ####
2023-06-30 15:25:39 -04:00
WINDOWS_BINARY_NAME: ./release/windows/{{.VERSION}}/kode-creator.exe
LINUX_BINARY_NAME: ./release/linux/{{.VERSION}}/kode-creator
2023-06-24 02:00:53 -04:00
2023-06-30 14:17:21 -04:00
# faire un build pour Windows sur linux il faut installer mingw-w64
# sudo apt-get install mingw-w64
2023-06-30 15:25:39 -04:00
# ** Cette fonctionnalité est toujours en cours de test **
# env:
# GOOS: windows
# GOARCH: amd64
2023-06-24 02:00:53 -04:00
tasks:
2023-07-01 00:49:45 -04:00
######### L I N U X S E C T I O N ##########
# # # # # # # # # # # # # # # # # # # # # # # # #
#### Version Manager ####
2023-06-24 02:00:53 -04:00
## Make sure you have PATH the versionManager !!!
2023-07-01 00:49:45 -04:00
1.0-linux-version-build:
2023-06-24 02:00:53 -04:00
cmds:
- "cd ./version/ && versionManager go build"
2023-07-01 00:49:45 -04:00
1.1-linux-version-patch:
cmds:
- "cd ./version/ && versionManager go patch"
1.2-linux-version-minor:
cmds:
- "cd ./version/ && versionManager go minor"
1.3-linux-version-major:
cmds:
- "cd ./version/ && versionManager go major"
2023-06-24 02:00:53 -04:00
2023-07-01 00:49:45 -04:00
#### Build ####
2.0-linux-build:
2023-06-24 02:00:53 -04:00
cmds:
- "{{.GOBUILD}} {{.LINUX_BINARY_NAME}} -v"
2023-07-01 00:49:45 -04:00
#### change Build, patch, minor or major version and BUILD ####
3.0-linux-vbuild:
cmds:
- task: 1.0-linux-version-build
- task: 2.0-linux-build
3.1-linux-vpatch:
cmds:
- task: 1.1-linux-version-patch
- task: 2.0-linux-build
3.2-linux-vminor:
2023-06-24 02:00:53 -04:00
cmds:
2023-07-01 00:49:45 -04:00
- task: 1.2-linux-version-minor
- task: 2.0-linux-build
3.3-linux-vmajor:
cmds:
- task: 1.3-linux-version-major
- task: 2.0-linux-build
#### install on LINUX OS ####
4.0-linux-install:
cmds:
- "cp {{.LINUX_BINARY_NAME}} {{.HOME}}/dev/outils/kode-creator/"
- "chmod +x {{.HOME}}/dev/outils/kode-creator/kode-creator"
- "cp ./config.yml {{.HOME}}/dev/outils/kode-creator/"
#### LINUX - Build ==> Install ####
5.0-LINUX-bi:
cmds:
- task: 3.0-linux-vbuild
- task: 4.0-linux-install
5.1-LINUX-pi:
cmds:
- task: 3.1-linux-vpatch
- task: 4.0-linux-install
5.2-LINUX-mini:
cmds:
- task: 3.2-linux-vminor
- task: 4.0-linux-install
5.3-LINUX-maji:
cmds:
- task: 3.3-linux-vmajor
- task: 4.0-linux-install
2023-06-24 02:00:53 -04:00
2023-07-01 00:49:45 -04:00
######### W I N D O W S S E C T I O N ##########
# # # # # # # # # # # # # # # # # # # # # # # # # # #
2023-06-24 02:00:53 -04:00
## Make sure you have PATH the versionManager.exe !!!
windows-version:
cmds:
- "cd ./version/ && versionManager.exe go build"
2023-06-30 14:17:21 -04:00
# silent: true
2023-06-24 02:00:53 -04:00
windows-build:
cmds:
- "{{.GOBUILD}} {{.WINDOWS_BINARY_NAME}} -v"
2023-06-30 14:17:21 -04:00
# silent: true
2023-06-24 02:00:53 -04:00
## change Build version and build
windows-vbuild:
cmds:
- task: windows-version
- task: windows-build
2023-07-01 00:49:45 -04:00