-
Notifications
You must be signed in to change notification settings - Fork 0
/
taskfile.yaml
35 lines (31 loc) · 1.04 KB
/
taskfile.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
version: '3'
vars:
NEXT_VERSION:
sh: |
VERSION=$(git tag --sort=-v:refname | head -n 1)
MAJOR=$(echo $VERSION | cut -d. -f1)
MINOR=$(echo $VERSION | cut -d. -f2)
PATCH=$(echo $VERSION | cut -d. -f3)
NEW_TAG="$MAJOR.$MINOR.$((PATCH+1))"
echo "$NEW_TAG"
tasks:
build:
desc: Build the binary for different platforms
cmds:
- rm -r builds
- go mod tidy
- GOOS=darwin GOARCH=arm64 go build -o builds/calbridge-darwin-arm64-{{.NEXT_VERSION}} cmd/main.go
- GOOS=linux GOARCH=amd64 go build -o builds/calbridge-linux-amd64-{{.NEXT_VERSION}} cmd/main.go
- GOOS=linux GOARCH=arm64 go build -o builds/calbridge-linux-arm64-{{.NEXT_VERSION}} cmd/main.go
env:
CGO_ENABLED: 0
release:
desc: Create a new GitHub release and upload binaries
cmds:
- gh release create {{.NEXT_VERSION}} builds/* --title "Release {{.NEXT_VERSION}}" --notes "Release for {{.NEXT_VERSION}}"
- git fetch --tags
all:
desc: Build and release
cmds:
- task: build
- task: release