authorgravatar for hello@nektro.netMeghan <hello@nektro.net> 2020-11-09 11:54:40 -08:00
committergravatar for hello@nektro.netMeghan <hello@nektro.net> 2020-11-09 11:54:40 -08:00
loga1b3e7f6b86413e303b69de73944c3a989c55040
tree06f8e3e5efa38a06c2d3b9f9e88683d2e01e0901
parentd0d7d4d85a13abb195bde71c210285e7541aa62c

add main


4 files changed, 56 insertions(+), 0 deletions(-)

.gitignore created+2
...@@ -0,0 +1,2 @@
1/bin
2/zigmod*
LICENSE created+21
...@@ -0,0 +1,21 @@
1MIT License
2
3Copyright (c) 2020 Meghan Denny
4
5Permission is hereby granted, free of charge, to any person obtaining a copy
6of this software and associated documentation files (the "Software"), to deal
7in the Software without restriction, including without limitation the rights
8to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9copies of the Software, and to permit persons to whom the Software is
10furnished to do so, subject to the following conditions:
11
12The above copyright notice and this permission notice shall be included in all
13copies or substantial portions of the Software.
14
15THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21SOFTWARE.
build_all.sh created+29
...@@ -0,0 +1,29 @@
1#!/usr/bin/env bash
2
3# set -e
4
5build_template() {
6 export CGO_ENABLED=0
7 export GOOS=$1
8 export GOARCH=$2
9 export GOARM=7
10 ext=$3
11 date=$(date +'%Y.%m.%d')
12 version=${CIRCLE_BUILD_NUM-$date}
13 tag=v$version-$(git log --format=%h -1)
14 echo $tag-$GOOS-$GOARCH
15 go build -ldflags="-s -w -X main.Version=$tag" -o ./bin/zigmod-$tag-$GOOS-$GOARCH$ext
16}
17
18# go tool dist list | grep amd64
19# build_template android amd64
20build_template darwin amd64
21build_template dragonfly amd64
22build_template freebsd amd64
23build_template illumos amd64
24build_template linux amd64
25build_template netbsd amd64
26build_template openbsd amd64
27build_template plan9 amd64
28build_template solaris amd64
29build_template windows amd64 .exe
main.go created+4
...@@ -0,0 +1,4 @@
1
2func assert(x bool, msg string) {
3 util.DieOnError(util.Assert(x, msg))
4}