1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-14 03:51:24 +02:00

chore(ci): update taskfile, rm makefile

refs #2557

Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
This commit is contained in:
Carlos A Becker 2021-10-05 20:20:23 -03:00
parent c1e61bdd1e
commit f4a751579a
No known key found for this signature in database
GPG Key ID: E61E2F7DC14AB940
4 changed files with 16 additions and 89 deletions

View File

@ -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

View File

@ -11,7 +11,7 @@ vars:
tasks:
dev:
desc: Setup pre-commit
desc: Setup git hooks
cmds:
- 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
cover:
desc: Run all the tests and opens the coverage report
desc: Open the cover tool
cmds:
- go tool cover -html=coverage.txt
fmt:
desc: gofmt and goimports all go files
desc: gofumpt all code
cmds:
- gofumpt -w -l -s .
@ -50,7 +50,7 @@ tasks:
desc: Run all the tests and code checks
deps: [build test]
imgs:
docs:imgs:
desc: Download and resize images
cmds:
- wget -O www/docs/static/logo.png https://github.com/goreleaser/artwork/raw/master/goreleaserfundo.png
@ -64,16 +64,8 @@ tasks:
cmds:
- '{{.DOCKER}} run --rm -it -p 8000:8000 -v ${PWD}/www:/docs docker.io/squidfunk/mkdocs-material'
docs:build:
desc: Build documentation
docs:vercel:build:
desc: Build documentation for deploying to Vercel
cmds:
- yum install -y jq
- pip install mkdocs-material mkdocs-minify-plugin lunr
- ./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' .
- scripts/vercel/install.sh
- scripts/vercel/build.sh

4
scripts/vercel/build.sh Executable file
View 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
View File

@ -0,0 +1,4 @@
#!/bin/bash
set -euo pipefail
yum install -y jq
pip install mkdocs-material mkdocs-minify-plugin lunr