Skip to content

Commit

Permalink
improve
Browse files Browse the repository at this point in the history
  • Loading branch information
labkode committed Oct 24, 2019
1 parent 49c3ded commit 7e725d0
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,7 @@ release-deps:
cd /tmp && go get github.com/restic/calens

# create local build versions
dist: off
dist: default
go run tools/create-artifacts/main.go -version ${VERSION} -commit ${GIT_COMMIT} -branch ${GIT_BRANCH} -goversion ${GO_VERSION}

all: deps default
11 changes: 9 additions & 2 deletions tools/create-artifacts/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,15 @@ func init() {

func main() {

os.RemoveAll("dist")
os.MkdirAll("dist", 0755)
if err := os.RemoveAll("dist"); err != nil {
fmt.Fprintf(os.Stderr, "error removing dist folder: %s", err)
os.Exit(1)
}

if err := os.MkdirAll("dist", 0755); err != nil {
fmt.Fprintf(os.Stderr, "error creating dist folder: %s", err)
os.Exit(1)
}

ldFlags := fmt.Sprintf("-s -X main.buildDate=%s -X main.gitCommit=%s -X main.gitBranch=%s -X main.version=%s -X main.goVersion=%s",
buildDate,
Expand Down
6 changes: 5 additions & 1 deletion tools/prepare-release/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ func main() {
return
}

// also the build is okay
cmd := exec.Command("make", "all")
run(cmd)

fmt.Printf("Generating new release: version=%s\n", *version)

dt := time.Now()
Expand All @@ -65,7 +69,7 @@ func main() {
os.Exit(1)
}

cmd := exec.Command("mv", "changelog/unreleased", newChangelog)
cmd = exec.Command("mv", "changelog/unreleased", newChangelog)
run(cmd)

// install release-deps: calens
Expand Down

0 comments on commit 7e725d0

Please sign in to comment.