1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-03-17 20:47:50 +02:00

chore: automating docs deployment

Auto-deploy docs on releases.
Should test it first, though.
This commit is contained in:
Carlos Alexandro Becker 2017-12-05 21:59:57 -02:00 committed by Carlos Alexandro Becker
parent d4a54c9381
commit ccd72344cc
2 changed files with 18 additions and 6 deletions

View File

@ -17,6 +17,6 @@ script:
after_success:
- bash <(curl -s https://codecov.io/bash)
- test -n "$TRAVIS_TAG" && docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
- test -n "$TRAVIS_TAG" && go run main.go
- test -n "$TRAVIS_TAG" && go run main.go && make static-push
notifications:
email: false

View File

@ -11,42 +11,54 @@ setup:
go get -u github.com/apex/static/cmd/static-docs
dep ensure
gometalinter --install
.PHONY: setup
# Run all the tests
test:
gotestcover $(TEST_OPTIONS) -covermode=atomic -coverprofile=coverage.txt $(SOURCE_FILES) -run $(TEST_PATTERN) -timeout=2m
.PHONY: cover
# 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:
find . -name '*.go' -not -wholename './vendor/*' | while read -r file; do gofmt -w -s "$$file"; goimports -w "$$file"; done
.PHONY: fmt
# Run all the linters
lint:
gometalinter --vendor ./...
.PHONY: lint
# Run all the tests and code checks
ci: test lint
.PHONY: ci
# Build a beta version of goreleaser
build:
go build
HIGHLIGHT=https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0
.PHONY: build
# Generate the static documentation
static:
@rm -rf ../goreleaser.github.io/theme
@rm -rf dist/goreleaser.github.io
@mkdir -p dist
@git clone git@github.com:goreleaser/goreleaser.github.io.git dist/goreleaser.github.io
@rm -rf dist/goreleaser.github.io/theme
@static-docs \
--in docs \
--out ../goreleaser.github.io \
--out dist/goreleaser.github.io \
--title GoReleaser \
--subtitle "Deliver Go binaries as fast and easily as possible" \
--google UA-106198408-1
@cd ../goreleaser.github.io && git add -A && git commit -am 'bump: docs' && git push origin master
.PHONY: static
static-push: static
@cd dist/goreleaser.github.io && git add -A && git commit -am 'bump: docs' && git diff --exit-code origin/master..master > /dev/null || git push origin master
.PHONY: static-push
# Show to-do items per file.
todo: