1
0
mirror of https://github.com/go-task/task.git synced 2025-07-17 01:43:07 +02:00

improvements on release process

This commit is contained in:
Andrey Nering
2017-06-14 15:28:35 -03:00
parent e97fd65cd3
commit 685b9ae293
3 changed files with 40 additions and 4 deletions

View File

@ -3,7 +3,9 @@
install: install:
desc: Installs Task desc: Installs Task
cmds: cmds:
- go install -v ./... - go install -v -ldflags="-w -s -X main.version={{.GIT_COMMIT}}" ./cmd/task
vars:
GIT_COMMIT: $git log -n 1 --format=%h
dl-deps: dl-deps:
desc: Downloads cli dependencies desc: Downloads cli dependencies
@ -17,6 +19,11 @@ update-deps:
- dep ensure - dep ensure
- dep prune - dep prune
clean:
desc: Cleans temp files and folders
cmds:
- rm -rf dist/
lint: lint:
desc: Runs golint desc: Runs golint
cmds: cmds:
@ -35,3 +42,8 @@ release:
desc: Release Task desc: Release Task
cmds: cmds:
- goreleaser - goreleaser
test-release:
desc: Tests release process without publishing
cmds:
- goreleaser --skip-validate --skip-publish

View File

@ -9,6 +9,10 @@ import (
"github.com/spf13/pflag" "github.com/spf13/pflag"
) )
var (
version = "master"
)
func main() { func main() {
log.SetFlags(0) log.SetFlags(0)
@ -30,16 +34,23 @@ hello:
} }
var ( var (
init bool versionFlag bool
force bool init bool
watch bool force bool
watch bool
) )
pflag.BoolVar(&versionFlag, "version", false, "show Task version")
pflag.BoolVarP(&init, "init", "i", false, "creates a new Taskfile.yml in the current folder") pflag.BoolVarP(&init, "init", "i", false, "creates a new Taskfile.yml in the current folder")
pflag.BoolVarP(&force, "force", "f", false, "forces execution even when the task is up-to-date") pflag.BoolVarP(&force, "force", "f", false, "forces execution even when the task is up-to-date")
pflag.BoolVarP(&watch, "watch", "w", false, "enables watch of the given task") pflag.BoolVarP(&watch, "watch", "w", false, "enables watch of the given task")
pflag.Parse() pflag.Parse()
if versionFlag {
log.Printf("Task version: %s\n", version)
return
}
if init { if init {
if err := task.InitTaskfile(); err != nil { if err := task.InitTaskfile(); err != nil {
log.Fatal(err) log.Fatal(err)

View File

@ -8,3 +8,16 @@ build:
goarch: goarch:
- 386 - 386
- amd64 - amd64
ignore:
- goos: darwin
goarch: 386
archive:
format_overrides:
- goos: windows
format: zip
replacements:
amd64: x64
386: x86
darwin: macOS