This repository was archived by the owner on Aug 5, 2022. It is now read-only.
File tree 8 files changed +301
-65
lines changed
8 files changed +301
-65
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash -xe
2
+
3
+ VERSION=` cat main.go| grep " const Version" | cut -f4 -d " " | tr -d ' "' `
4
+
5
+ # Remember to set GOROOT accordingly with your installation
6
+
7
+ export GOPATH=$PWD
8
+
9
+ declare -a target_folders=(" linux_amd64" " linux_386" " linux_arm" " darwin_amd64" " windows_386" )
10
+
11
+ rm -rf distrib
12
+ mkdir distrib
13
+
14
+ package_index=` cat package_index.template | sed s/%%VERSION%%/${VERSION} /`
15
+
16
+ for folder in " ${target_folders[@]} "
17
+ do
18
+ rm -rf arduino101load*
19
+ rm -rf bin
20
+ mkdir bin
21
+ IFS=_ read -a fields <<< $folder
22
+ GOOS=${fields[0]} GOARCH=${fields[1]} go build
23
+ FILENAME=arduino101load-${VERSION} -${folder} .tar.bz2
24
+ cp -r arduino101load* firmwares/ bin
25
+ tar cjvf ${FILENAME} bin/
26
+ T_OS=` echo ${folder} | awk ' {print toupper($0)}' `
27
+ SHASUM=` sha256sum ${FILENAME} | cut -f1 -d" " `
28
+ SIZE=` stat --printf=" %s" ${FILENAME} `
29
+ package_index=` echo $package_index |
30
+ sed s/%%FILENAME_${T_OS} %%/${FILENAME} / |
31
+ sed s/%%FILENAME_${T_OS} %%/${FILENAME} / |
32
+ sed s/%%SIZE_${T_OS} %%/${SIZE} / |
33
+ sed s/%%SHA_${T_OS} %%/${SHASUM} /`
34
+
35
+ mv ${FILENAME} distrib/
36
+ done
37
+
38
+ set +x
39
+
40
+ echo ================== CUT ME HERE =====================
41
+
42
+ echo ${package_index} | python -m json.tool
43
+
You can’t perform that action at this time.
0 commit comments