-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskfile.yml
59 lines (53 loc) · 1.98 KB
/
Taskfile.yml
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
version: '3'
tasks:
install:
desc: Install Pre-requisites
summary: Installs the various tools needed to work with this project
cmds:
- go install github.com/golangci/golangci-lint/cmd/[email protected]
- go install mvdan.cc/gofumpt@latest
- go install gotest.tools/gotestsum@latest
format:
desc: Run 'goimports' to format go imports
summary: Runs goimports on all files with -local support, can also replace gofmt
cmds:
- goimports -local github.com/vallieres -w .
- go mod tidy
- gofumpt -l -w .
lint:
desc: Code Linting
summary: Lint the project files with golangci-lint
cmds:
- golangci-lint run -c .golangci.yml
test:
desc: Run the tests
summary: Runs the tests
cmds:
- gotestsum ./... -race -count=1 -p 1 -coverprofile=coverage.out -coverpkg=./...
- go tool cover -html=coverage.out -o coverage.html
release:
desc: Releases a new version
summary: Release a new version of Crawl n' Index
silent: true
cmds:
- |
echo -e "\nℹ️ This command will prompt you to provide the Git tag and Release name \n in order to release a new version of Crawl n' IndexNow.\n"
LATEST=$(git describe --tags $(git rev-list --tags --max-count=1))
BRANCH=$(git symbolic-ref --short -q HEAD)
if [ "$BRANCH" != "main" ]; then
echo -e "\n❗Tags should be created on an up-to-date main branch!❗"
exit
fi
echo -e "→ Latest tag: $LATEST \n"
echo "Enter the new tag (include the "v"):"
read TAG;
echo "Enter the release name:"
read NAME;
echo -e "\nYou typed: ${TAG}, ${NAME} \nType Enter to continue or Ctrl+D to exit...";
read NIL;
echo -e "→ Creating the Git tag ${TAG}..."
git tag -a ${TAG} -m "${NAME}"
git push origin ${TAG}
echo -e "\n→ Generating GoReleaser release..."
goreleaser release --clean
echo -e "\n✅ Completed!"