File tree 4 files changed +57
-0
lines changed
4 files changed +57
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ echo " Build and upload binaries to calaos.fr"
4
+
5
+ if [ " x$UPLOAD_KEY " == " x" ]; then
6
+ echo " Error, UPLOAD_KEY is not set"
7
+ exit 1
8
+ fi
9
+
10
+ function upload_file()
11
+ {
12
+ FNAME=$1
13
+ HASH=$( sha256sum $FNAME | cut -d' ' -f1)
14
+ INSTALLPATH=$2
15
+
16
+ echo " Uploading file $FNAME "
17
+
18
+ curl -X POST \
19
+ -H " Content-Type: multipart/form-data" \
20
+ -F " upload_key=$UPLOAD_KEY " \
21
+ -F " upload_folder=$INSTALLPATH " \
22
+ -F " upload_sha256=$HASH " \
23
+ -F " upload_file=@$FNAME " \
24
+ --progress-bar \
25
+ https://calaos.fr/mooltipass/upload -o upload.log
26
+ rm -f upload.log
27
+ }
28
+
29
+ BIN=" moolticute-cli"
30
+
31
+ echo " >> Building windows bin"
32
+ export GO15VENDOREXPERIMENT=1
33
+ export CGO_ENABLED=0
34
+
35
+ export GOARCH=386
36
+ export GOOS=windows
37
+ go env
38
+ rm -f ${BIN} .exe
39
+ go build -i
40
+ upload_file ${BIN} .exe " tools/windows"
41
+
42
+ echo " >> Building linux bin"
43
+ export GOARCH=amd64
44
+ export GOOS=linux
45
+ go env
46
+ rm -f $BIN ${BIN} .exe
47
+ go build -i
48
+ upload_file ${BIN} " tools/linux"
49
+
50
+ echo " >> Building macos bin"
51
+ export GOARCH=amd64
52
+ export GOOS=darwin
53
+ go env
54
+ rm -f $BIN
55
+ go build -i
56
+ upload_file ${BIN} " tools/macos"
57
+
You can’t perform that action at this time.
0 commit comments