-
Notifications
You must be signed in to change notification settings - Fork 133
/
release.sh
executable file
·93 lines (69 loc) · 2.83 KB
/
release.sh
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#!/bin/sh
export VERSION="0.1.42"
plat="$(uname -s | awk '{print tolower($0)}')"
# x86-linux
GOARCH=amd64 GO111MODULE=on GOOS=linux go build -ldflags "-X github.com/nanovms/ops/lepton.Version=$VERSION"
gsutil cp ops gs://cli/linux
nfpm pkg --packager deb --target /tmp/
nfpm pkg --packager rpm --target /tmp/
curl -F package=@/tmp/ops_"$VERSION"_amd64.deb https://[email protected]/nanovms/
curl -F package=@/tmp/ops-"$VERSION".x86_64.rpm https://[email protected]/nanovms/
hash="ops-linux-$VERSION.md5"
if [ "$plat" = 'darwin' ]
then
md5 -q ops > "$hash"
else
md5sum ops | awk '{print $1}' > "$hash"
fi
gsutil cp ops gs://cli/linux/release/"$VERSION"/ops
gsutil setacl public-read gs://cli/linux/release/"$VERSION"/ops
gsutil cp "$hash" gs://cli/linux/release/"$VERSION"/"$hash"
gsutil setacl public-read gs://cli/linux/release/"$VERSION"/"$hash"
# x86-darwin
# TODO:
# flag here with "-X github.com/nanovms/ops/qemu.OPSD=true" for signed/packaged mac binaries
GOARCH=amd64 GO111MODULE=on GOOS=darwin go build -ldflags "-w -X github.com/nanovms/ops/lepton.Version=$VERSION"
gsutil cp ops gs://cli/darwin
hash="ops-darwin-$VERSION.md5"
if [ "$plat" = 'darwin' ]
then
md5 -q ops > "$hash"
else
md5sum ops | awk '{print $1}' > "$hash"
fi
gsutil cp ops gs://cli/darwin/release/"$VERSION"/ops
gsutil setacl public-read gs://cli/darwin/release/"$VERSION"/ops
gsutil cp "$hash" gs://cli/darwin/release/"$VERSION"/"$hash"
gsutil setacl public-read gs://cli/darwin/release/"$VERSION"/"$hash"
# arm64-linux
GO111MODULE=on GOOS=linux GOARCH=arm64 go build -ldflags "-X github.com/nanovms/ops/lepton.Version=$VERSION"
gsutil cp ops gs://cli/linux/aarch64/
hash="ops-linux-aarch64-$VERSION.md5"
if [ "$plat" = 'darwin' ]
then
md5 -q ops > "$hash"
else
md5sum ops | awk '{print $1}' > "$hash"
fi
gsutil cp ops gs://cli/linux/aarch64/release/"$VERSION"/ops
gsutil setacl public-read gs://cli/linux/aarch64/release/"$VERSION"/ops
gsutil cp "$hash" gs://cli/linux/aarch64/release/"$VERSION"/"$hash"
gsutil setacl public-read gs://cli/linux/aarch64/release/"$VERSION"/"$hash"
# arm64-darwin
GO111MODULE=on GOOS=darwin GOARCH=arm64 go build -ldflags "-X github.com/nanovms/ops/lepton.Version=$VERSION"
gsutil cp ops gs://cli/darwin/aarch64/
hash="ops-darwin-aarch64-$VERSION.md5"
if [ "$plat" = 'darwin' ]
then
md5 -q ops > "$hash"
else
md5sum ops | awk '{print $1}' > "$hash"
fi
gsutil cp ops gs://cli/darwin/aarch64/release/"$VERSION"/ops
gsutil setacl public-read gs://cli/darwin/aarch64/release/"$VERSION"/ops
gsutil cp "$hash" gs://cli/darwin/aarch64/release/"$VERSION"/"$hash"
gsutil setacl public-read gs://cli/darwin/aarch64/release/"$VERSION"/"$hash"
gsutil -D setacl public-read gs://cli/linux/ops
gsutil -D setacl public-read gs://cli/linux/aarch64/ops
gsutil -D setacl public-read gs://cli/darwin/ops
gsutil -D setacl public-read gs://cli/darwin/aarch64/ops