mirror of
https://github.com/go-task/task.git
synced 2025-02-03 13:22:11 +02:00
improvements on release process
This commit is contained in:
parent
e97fd65cd3
commit
685b9ae293
14
Taskfile.yml
14
Taskfile.yml
@ -3,7 +3,9 @@
|
||||
install:
|
||||
desc: Installs Task
|
||||
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:
|
||||
desc: Downloads cli dependencies
|
||||
@ -17,6 +19,11 @@ update-deps:
|
||||
- dep ensure
|
||||
- dep prune
|
||||
|
||||
clean:
|
||||
desc: Cleans temp files and folders
|
||||
cmds:
|
||||
- rm -rf dist/
|
||||
|
||||
lint:
|
||||
desc: Runs golint
|
||||
cmds:
|
||||
@ -35,3 +42,8 @@ release:
|
||||
desc: Release Task
|
||||
cmds:
|
||||
- goreleaser
|
||||
|
||||
test-release:
|
||||
desc: Tests release process without publishing
|
||||
cmds:
|
||||
- goreleaser --skip-validate --skip-publish
|
||||
|
@ -9,6 +9,10 @@ import (
|
||||
"github.com/spf13/pflag"
|
||||
)
|
||||
|
||||
var (
|
||||
version = "master"
|
||||
)
|
||||
|
||||
func main() {
|
||||
log.SetFlags(0)
|
||||
|
||||
@ -30,16 +34,23 @@ hello:
|
||||
}
|
||||
|
||||
var (
|
||||
init bool
|
||||
force bool
|
||||
watch bool
|
||||
versionFlag bool
|
||||
init 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(&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.Parse()
|
||||
|
||||
if versionFlag {
|
||||
log.Printf("Task version: %s\n", version)
|
||||
return
|
||||
}
|
||||
|
||||
if init {
|
||||
if err := task.InitTaskfile(); err != nil {
|
||||
log.Fatal(err)
|
||||
|
@ -8,3 +8,16 @@ build:
|
||||
goarch:
|
||||
- 386
|
||||
- amd64
|
||||
ignore:
|
||||
- goos: darwin
|
||||
goarch: 386
|
||||
|
||||
archive:
|
||||
format_overrides:
|
||||
- goos: windows
|
||||
format: zip
|
||||
|
||||
replacements:
|
||||
amd64: x64
|
||||
386: x86
|
||||
darwin: macOS
|
||||
|
Loading…
x
Reference in New Issue
Block a user