Files
go-api-template/Taskfile.yml

81 lines
1.5 KiB
YAML

# https://taskfile.dev
version: '3'
env:
CURRENT_RELEASE: 0.1.0
RELEASE_MSG: "First official release of the project"
GO_VERSION: 1.16.3
tasks:
build:
cmds:
- goreleaser
install-backend:
cmds:
- go install
install-goreleaser:
cmds:
- go install github.com/goreleaser/goreleaser@latest
install-frontend:
dir:
frontend
cmds:
- npm install
install-all:
deps:
- install-backend
- install-frontend
release-local:
cmds:
- goreleaser check
- goreleaser release --snapshot --skip-publish --rm-dist
release:
summary: |
Requires the GITHUB_TOKEN env variable to release to github
Make sure you push a tag to github if it is a versioned release
cmds:
- git tag -a {{.CURRENT_RELEASE}} -m {{.RELEASE_MSG}}
- git push origin {{.CURRENT_RELEASE}}
- goreleaser release
release-snapshot:
summary: |
Requires the GITHUB_TOKEN env variable to release to github
Releases an unversioned snapshot to github
cmds:
- goreleaser release --snapshot --rm-dist --debug
run-frontend:
dir:
frontend
cmds:
- npm run start
build-frontend:
dir: frontend
sources:
- src/**/*.js
generates:
- build/js/*.js
run-backend:
env:
SERVER_PORT: 3500
# TZ: "America/New_York"
sources:
- ./*.go
cmds:
- go run .
run-all:
deps:
- build-frontend
- run-backend