-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
45 lines (43 loc) · 938 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package main
import (
"fmt"
"path"
"publish/android"
"publish/consts"
"publish/file_manager"
"publish/http"
"publish/server"
)
func main() {
consts.LoadEnv()
fmt.Println("Building Bundle...")
err := android.BuildGradlew(":TMessagesProj_App:bundlePlay")
if err != nil {
panic(err)
}
fmt.Println("Building APKs...")
err = android.BuildGradlew(":TMessagesProj_App:assembleRelease")
if err != nil {
panic(err)
}
files, err := file_manager.GetFiles(consts.BuildOutputsPath)
if err != nil {
panic(err)
}
zipFile := path.Join(consts.CurrentPath, "temp", "publish.zip")
err = file_manager.ZipFiles(files, zipFile)
if err != nil {
panic(err)
}
fmt.Println("Sending to NAOS Server...")
err = server.UploadFile(zipFile)
if err != nil {
panic(err)
}
err = http.Notify()
if err != nil {
fmt.Println("\nError when sending to OwlGram Servers, ", err)
} else {
fmt.Println("\nSent to OwlGram Servers!")
}
}