Automatize version number, add goreleaser to gitpod Dockerfile

- Automatized version number
- Added goreleaser to gitpod Dockerfile
This commit is contained in:
Medzik 2021-07-26 09:32:50 +00:00
parent cf0bb1c0a6
commit 87f5dfb2e1
4 changed files with 12 additions and 4 deletions

2
.gitpod.Dockerfile vendored
View File

@ -1,3 +1,5 @@
FROM gitpod/workspace-full
RUN brew install goreleaser
RUN npm i -g nodemon

View File

@ -12,6 +12,10 @@ builds:
binary: '{{ .ProjectName }}.out'
ldflags:
- -s -w
- -X gitlab.com/gaming0skar123/go/pingbot/config.Version={{.RawVersion}}
archives:
- format: tar.gz
@ -19,4 +23,6 @@ archives:
- none*
checksum:
name_template: 'checksums.txt'
name_template: 'md5_checksums.txt'
algorithm: md5

View File

@ -1,3 +1,3 @@
package config
var Version = "1.3.1"
var Version = "dev"

View File

@ -19,8 +19,8 @@ func Update() {
return
}
v := semver.MustParse(config.Version)
if !found || latest.Version.LTE(v) {
v, err := semver.Parse(config.Version)
if common.CheckErr(err, "parse version") || !found || latest.Version.LTE(v) {
return
}