version: '3' vars: BINARY_NAME: gitsyncer BUILD_DIR: . CMD_PATH: ./cmd/gitsyncer LDFLAGS: -s -w tasks: default: desc: Build the gitsyncer binary cmds: - go build -ldflags "{{.LDFLAGS}}" -o {{.BUILD_DIR}}/{{.BINARY_NAME}} {{.CMD_PATH}} build: desc: Build the gitsyncer binary cmds: - go build -ldflags "{{.LDFLAGS}}" -o {{.BUILD_DIR}}/{{.BINARY_NAME}} {{.CMD_PATH}} build-all: desc: Build for all supported platforms cmds: - task: build-linux - task: build-darwin - task: build-windows build-linux: desc: Build for Linux cmds: - GOOS=linux GOARCH=amd64 go build -ldflags "{{.LDFLAGS}}" -o {{.BUILD_DIR}}/{{.BINARY_NAME}}-linux-amd64 {{.CMD_PATH}} build-darwin: desc: Build for macOS cmds: - GOOS=darwin GOARCH=amd64 go build -ldflags "{{.LDFLAGS}}" -o {{.BUILD_DIR}}/{{.BINARY_NAME}}-darwin-amd64 {{.CMD_PATH}} - GOOS=darwin GOARCH=arm64 go build -ldflags "{{.LDFLAGS}}" -o {{.BUILD_DIR}}/{{.BINARY_NAME}}-darwin-arm64 {{.CMD_PATH}} build-windows: desc: Build for Windows cmds: - GOOS=windows GOARCH=amd64 go build -ldflags "{{.LDFLAGS}}" -o {{.BUILD_DIR}}/{{.BINARY_NAME}}-windows-amd64.exe {{.CMD_PATH}} run: desc: Build and run the gitsyncer binary cmds: - task: build - ./{{.BINARY_NAME}} test: desc: Run tests cmds: - go test ./... test-verbose: desc: Run tests with verbose output cmds: - go test -v ./... clean: desc: Clean build artifacts cmds: - rm -f {{.BINARY_NAME}} - rm -f {{.BINARY_NAME}}-* mod-tidy: desc: Tidy go modules cmds: - go mod tidy fmt: desc: Format Go code cmds: - go fmt ./... vet: desc: Run go vet cmds: - go vet ./... lint: desc: Run golangci-lint cmds: - golangci-lint run install: desc: Install gitsyncer to $GOPATH/bin cmds: - go install {{.CMD_PATH}} version: desc: Show version deps: [build] cmds: - ./{{.BINARY_NAME}} --version