Skip to content

Commit

Permalink
misc scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
amitsaha committed Apr 16, 2019
1 parent c6cbed1 commit bc6af8e
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ deploy:
skip_cleanup: true
on:
tags: true
draft: true
26 changes: 26 additions & 0 deletions build-binaries.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import subprocess
import os

VERSION=subprocess.check_output(["git", "describe", "--abbrev=0", "--tags"]).decode("utf-8").rstrip("\n")
DISTDIR="./artifacts"

distpairs = [
"linux/386",
"linux/amd64",
"linux/arm",
"linux/arm64",
"darwin/amd64",
"dragonfly/amd64",
"freebsd/amd64",
"netbsd/amd64",
"openbsd/amd64",
"windows/amd64"
]

for distpair in distpairs:
GOOS = distpair.split("/")[0]
GOARCH = distpair.split("/")[1]
OBJECT_FILE="gitbackup-{0}-{1}-{2}".format(VERSION, GOOS, GOARCH)
subprocess.check_output(
["go", "build", "-o", "{0}/{1}".format(DISTDIR, OBJECT_FILE)],
env = {"GOOS": GOOS, "GOARCH": GOARCH, "GOPATH": os.environ.get("GOPATH"), "GOCACHE": "on", "GOROOT": os.environ.get("GOROOT")})

0 comments on commit bc6af8e

Please sign in to comment.