mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-04-23 12:18:50 +02:00
chore(ci): update taskfile, rm makefile
refs #2557 Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
This commit is contained in:
parent
c1e61bdd1e
commit
f4a751579a
73
Makefile
73
Makefile
@ -1,73 +0,0 @@
|
|||||||
SOURCE_FILES?=./...
|
|
||||||
TEST_PATTERN?=.
|
|
||||||
TEST_OPTIONS?=
|
|
||||||
DOCKER?=docker
|
|
||||||
|
|
||||||
export PATH := ./bin:$(PATH)
|
|
||||||
export GO111MODULE := on
|
|
||||||
export GOPROXY = https://proxy.golang.org,direct
|
|
||||||
|
|
||||||
# Setup pre-commit hooks
|
|
||||||
dev:
|
|
||||||
cp -f scripts/pre-commit.sh .git/hooks/pre-commit
|
|
||||||
.PHONY: dev
|
|
||||||
|
|
||||||
# Install dependencies
|
|
||||||
setup:
|
|
||||||
go mod tidy
|
|
||||||
.PHONY: setup
|
|
||||||
|
|
||||||
# Run all the tests
|
|
||||||
test:
|
|
||||||
LC_ALL=C go test $(TEST_OPTIONS) -failfast -race -coverpkg=./... -covermode=atomic -coverprofile=coverage.txt $(SOURCE_FILES) -run $(TEST_PATTERN) -timeout=5m
|
|
||||||
.PHONY: test
|
|
||||||
|
|
||||||
# Run all the tests and opens the coverage report
|
|
||||||
cover: test
|
|
||||||
go tool cover -html=coverage.txt
|
|
||||||
.PHONY: cover
|
|
||||||
|
|
||||||
# gofmt and goimports all go files
|
|
||||||
fmt:
|
|
||||||
gofumpt -w -l -s .
|
|
||||||
.PHONY: fmt
|
|
||||||
|
|
||||||
# Run all the tests and code checks
|
|
||||||
ci: build test
|
|
||||||
.PHONY: ci
|
|
||||||
|
|
||||||
# Build a beta version of goreleaser
|
|
||||||
build:
|
|
||||||
go build
|
|
||||||
.PHONY: build
|
|
||||||
|
|
||||||
imgs:
|
|
||||||
wget -O www/docs/static/logo.png https://github.com/goreleaser/artwork/raw/master/goreleaserfundo.png
|
|
||||||
wget -O www/docs/static/card.png "https://og.caarlos0.dev/**GoReleaser**%20%7C%20Deliver%20Go%20binaries%20as%20fast%20and%20easily%20as%20possible.png?theme=light&md=1&fontSize=80px&images=https://github.com/goreleaser.png"
|
|
||||||
wget -O www/docs/static/avatar.png https://github.com/goreleaser.png
|
|
||||||
convert www/docs/static/avatar.png -define icon:auto-resize=64,48,32,16 docs/static/favicon.ico
|
|
||||||
convert www/docs/static/avatar.png -resize x120 www/docs/static/apple-touch-icon.png
|
|
||||||
.PHONY: imgs
|
|
||||||
|
|
||||||
serve:
|
|
||||||
$(DOCKER) run --rm -it -p 8000:8000 -v ${PWD}/www:/docs docker.io/squidfunk/mkdocs-material
|
|
||||||
.PHONY: serve
|
|
||||||
|
|
||||||
vercel:
|
|
||||||
yum install -y jq
|
|
||||||
pip install mkdocs-material mkdocs-minify-plugin lunr
|
|
||||||
./scripts/get-releases.sh
|
|
||||||
(cd www && mkdocs build)
|
|
||||||
|
|
||||||
# Show to-do items per file.
|
|
||||||
todo:
|
|
||||||
@grep \
|
|
||||||
--exclude-dir=vendor \
|
|
||||||
--exclude-dir=node_modules \
|
|
||||||
--exclude=Makefile \
|
|
||||||
--text \
|
|
||||||
--color \
|
|
||||||
-nRo -E ' TODO:.*|SkipNow' .
|
|
||||||
.PHONY: todo
|
|
||||||
|
|
||||||
.DEFAULT_GOAL := build
|
|
24
Taskfile.yml
24
Taskfile.yml
@ -11,7 +11,7 @@ vars:
|
|||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
dev:
|
dev:
|
||||||
desc: Setup pre-commit
|
desc: Setup git hooks
|
||||||
cmds:
|
cmds:
|
||||||
- cp -f scripts/pre-commit.sh .git/hooks/pre-commit
|
- cp -f scripts/pre-commit.sh .git/hooks/pre-commit
|
||||||
|
|
||||||
@ -37,12 +37,12 @@ tasks:
|
|||||||
- go test {{.TEST_OPTIONS}} -failfast -race -coverpkg=./... -covermode=atomic -coverprofile=coverage.txt {{.SOURCE_FILES}} -run {{.TEST_PATTERN}} -timeout=5m
|
- go test {{.TEST_OPTIONS}} -failfast -race -coverpkg=./... -covermode=atomic -coverprofile=coverage.txt {{.SOURCE_FILES}} -run {{.TEST_PATTERN}} -timeout=5m
|
||||||
|
|
||||||
cover:
|
cover:
|
||||||
desc: Run all the tests and opens the coverage report
|
desc: Open the cover tool
|
||||||
cmds:
|
cmds:
|
||||||
- go tool cover -html=coverage.txt
|
- go tool cover -html=coverage.txt
|
||||||
|
|
||||||
fmt:
|
fmt:
|
||||||
desc: gofmt and goimports all go files
|
desc: gofumpt all code
|
||||||
cmds:
|
cmds:
|
||||||
- gofumpt -w -l -s .
|
- gofumpt -w -l -s .
|
||||||
|
|
||||||
@ -50,7 +50,7 @@ tasks:
|
|||||||
desc: Run all the tests and code checks
|
desc: Run all the tests and code checks
|
||||||
deps: [build test]
|
deps: [build test]
|
||||||
|
|
||||||
imgs:
|
docs:imgs:
|
||||||
desc: Download and resize images
|
desc: Download and resize images
|
||||||
cmds:
|
cmds:
|
||||||
- wget -O www/docs/static/logo.png https://github.com/goreleaser/artwork/raw/master/goreleaserfundo.png
|
- wget -O www/docs/static/logo.png https://github.com/goreleaser/artwork/raw/master/goreleaserfundo.png
|
||||||
@ -64,16 +64,8 @@ tasks:
|
|||||||
cmds:
|
cmds:
|
||||||
- '{{.DOCKER}} run --rm -it -p 8000:8000 -v ${PWD}/www:/docs docker.io/squidfunk/mkdocs-material'
|
- '{{.DOCKER}} run --rm -it -p 8000:8000 -v ${PWD}/www:/docs docker.io/squidfunk/mkdocs-material'
|
||||||
|
|
||||||
docs:build:
|
docs:vercel:build:
|
||||||
desc: Build documentation
|
desc: Build documentation for deploying to Vercel
|
||||||
cmds:
|
cmds:
|
||||||
- yum install -y jq
|
- scripts/vercel/install.sh
|
||||||
- pip install mkdocs-material mkdocs-minify-plugin lunr
|
- scripts/vercel/build.sh
|
||||||
- ./scripts/get-releases.sh
|
|
||||||
- (cd www && mkdocs build)
|
|
||||||
|
|
||||||
todo:
|
|
||||||
desc: Show to-do items per file
|
|
||||||
silent: true
|
|
||||||
cmds:
|
|
||||||
- grep --exclude-dir=vendor --exclude-dir=node_modules --exclude=Makefile --text --color -nRo -E ' TODO:.*|SkipNow' .
|
|
||||||
|
4
scripts/vercel/build.sh
Executable file
4
scripts/vercel/build.sh
Executable file
@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -euo pipefail
|
||||||
|
./scripts/get-releases.sh
|
||||||
|
mkdocs build -f www/mkdocs.yml
|
4
scripts/vercel/install.sh
Executable file
4
scripts/vercel/install.sh
Executable file
@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -euo pipefail
|
||||||
|
yum install -y jq
|
||||||
|
pip install mkdocs-material mkdocs-minify-plugin lunr
|
Loading…
x
Reference in New Issue
Block a user