Add release:windows command

This commit is contained in:
kolaente 2020-09-02 17:56:48 +02:00
parent 26dda5185c
commit 33d410946a
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 19 additions and 1 deletions

View File

@ -394,15 +394,33 @@ func (Release) Release() {
// Creates all directories needed to release vikunja
func (Release) Dirs() error {
for _, d := range []string{"binaries", "release", "zip"} {
if err := os.MkdirAll(RootPath+"/"+DIST+"/"+d, os.ModeDir); err != nil {
if err := os.MkdirAll(RootPath+"/"+DIST+"/"+d, 0755); err != nil {
return err
}
}
return nil
}
// Builds binaries for windows
func (Release) Windows() {
checkAndInstallGoTool("xgo", "src.techknowlogick.com/xgo")
runAndStreamOutput("xgo",
"-dest", RootPath+"/"+DIST+"/binaries",
"-tags", "'netgo "+Tags+"'",
"-ldflags", "'-linkmode external -extldflags \"-static\" "+Ldflags+"'",
"-targets", "'windows/*'",
"-out", Executable+"-"+Version,
".")
if os.Getenv("DRONE_WORKSPACE") != "" {
//os.Rename("/build/")
}
/*
xgo -dest $(DIST)/binaries -tags 'netgo $(TAGS)' -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -targets 'windows/*' -out vikunja-$(VERSION) .
ifneq ($(DRONE_WORKSPACE),'')
mv /build/* $(DIST)/binaries
endif
*/
}
func (Release) Linux() {