mirror of
https://github.com/dnote/dnote
synced 2026-03-14 14:35:50 +01:00
Deprecate upgrade (#99)
* Deprecate upgrade * Automate using goreleaser * Fix name and version * Automate
This commit is contained in:
parent
50cfd9923d
commit
b3a12aed85
8 changed files with 40 additions and 22 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -3,3 +3,4 @@ main
|
|||
tmp/
|
||||
/vendor
|
||||
test-dnote
|
||||
/dist
|
||||
|
|
|
|||
25
.goreleaser.yml
Normal file
25
.goreleaser.yml
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
archive:
|
||||
format: binary
|
||||
name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}"
|
||||
|
||||
builds:
|
||||
-
|
||||
binary: dnote
|
||||
ldflags:
|
||||
- -X core.Version={{.Version}}
|
||||
- -X main.apiEndpoint=https://api.dnote.io
|
||||
goos:
|
||||
- darwin
|
||||
- linux
|
||||
- windows
|
||||
- openbsd
|
||||
goarch:
|
||||
- amd64
|
||||
- 386
|
||||
|
||||
changelog:
|
||||
sort: asc
|
||||
filters:
|
||||
exclude:
|
||||
- '^docs:'
|
||||
- '^refactor:'
|
||||
|
|
@ -4,7 +4,6 @@
|
|||
- [view](#dnote-view)
|
||||
- [edit](#dnote-edit)
|
||||
- [remove](#dnote-remove)
|
||||
- [upgrade](#dnote-upgrade)
|
||||
- [login](#dnote-login)
|
||||
- [sync](#dnote-sync)
|
||||
|
||||
|
|
@ -68,10 +67,6 @@ $ dnote remove JS 1
|
|||
$ dnote remove -b JS
|
||||
```
|
||||
|
||||
## dnote upgrade
|
||||
|
||||
Upgrade the Dnote if newer release is available
|
||||
|
||||
## dnote sync
|
||||
|
||||
_Dnote Cloud only_
|
||||
|
|
|
|||
14
Makefile
14
Makefile
|
|
@ -1,20 +1,14 @@
|
|||
release:
|
||||
@echo "** Releasing version $(VERSION)..."
|
||||
@echo "** Building..."
|
||||
@$(MAKE) build
|
||||
@echo "** Tagging and pushing..."
|
||||
@git tag -a $(VERSION) -m "$(VERSION)"
|
||||
@git push --tags
|
||||
@goreleaser
|
||||
.PHONY: release
|
||||
|
||||
build: install-gox
|
||||
@$(GOPATH)/bin/gox -ldflags "-X main.apiEndpoint=https://api.dnote.io" -osarch="darwin/386 darwin/amd64 linux/386 linux/amd64 openbsd/386 openbsd/amd64 window/386 windows/amd64" -output="dnote-{{.OS}}-{{.Arch}}" ./...
|
||||
.PHONY: build
|
||||
|
||||
install-gox:
|
||||
@echo "** Installing Gox..."
|
||||
@go get github.com/mitchellh/gox
|
||||
.PHONY: install-gox
|
||||
build-snapshot:
|
||||
@goreleaser --snapshot --rm-dist
|
||||
.PHONY: build-snapshot
|
||||
|
||||
clean:
|
||||
@git clean -f
|
||||
|
|
|
|||
|
|
@ -11,12 +11,15 @@ import (
|
|||
var example = `
|
||||
dnote upgrade`
|
||||
|
||||
var deprecationWarning = `see https://github.com/dnote/cli/issues/96.`
|
||||
|
||||
func NewCmd(ctx infra.DnoteCtx) *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "upgrade",
|
||||
Short: "Upgrades dnote",
|
||||
Example: example,
|
||||
RunE: newRun(ctx),
|
||||
Use: "upgrade",
|
||||
Short: "Upgrades dnote",
|
||||
Example: example,
|
||||
RunE: newRun(ctx),
|
||||
Deprecated: deprecationWarning,
|
||||
}
|
||||
|
||||
return cmd
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ func NewCmd(ctx infra.DnoteCtx) *cobra.Command {
|
|||
Short: "Print the version number of Dnote",
|
||||
Long: "Print the version number of Dnote",
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
fmt.Printf("dnote v%s\n", core.Version)
|
||||
fmt.Printf("dnote %s\n", core.Version)
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ import (
|
|||
|
||||
const (
|
||||
// Version is the current version of dnote
|
||||
Version = "0.4.0"
|
||||
Version = "master"
|
||||
|
||||
// TimestampFilename is the name of the file containing upgrade info
|
||||
TimestampFilename = "timestamps"
|
||||
|
|
|
|||
2
main.go
2
main.go
|
|
@ -17,11 +17,11 @@ import (
|
|||
"github.com/dnote/cli/cmd/edit"
|
||||
"github.com/dnote/cli/cmd/login"
|
||||
"github.com/dnote/cli/cmd/ls"
|
||||
"github.com/dnote/cli/cmd/view"
|
||||
"github.com/dnote/cli/cmd/remove"
|
||||
"github.com/dnote/cli/cmd/sync"
|
||||
"github.com/dnote/cli/cmd/upgrade"
|
||||
"github.com/dnote/cli/cmd/version"
|
||||
"github.com/dnote/cli/cmd/view"
|
||||
)
|
||||
|
||||
// apiEndpoint is populated during link time
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue