From d3e3e001f0e09a068f8f75398eaf53e75bca2ad3 Mon Sep 17 00:00:00 2001 From: Mansour Behabadi Date: Fri, 11 Dec 2020 01:29:09 +1100 Subject: [PATCH] Add windows builder --- contrib/Dockerfile | 6 ------ contrib/build | 3 --- contrib/build-windows | 27 +++++++++++++++++++++++++++ go.mod | 2 ++ go.sum | 4 ++++ 5 files changed, 33 insertions(+), 9 deletions(-) delete mode 100644 contrib/Dockerfile delete mode 100755 contrib/build create mode 100755 contrib/build-windows diff --git a/contrib/Dockerfile b/contrib/Dockerfile deleted file mode 100644 index ba2e9f5..0000000 --- a/contrib/Dockerfile +++ /dev/null @@ -1,6 +0,0 @@ -FROM debian:experimental - -RUN apt-get update -y && apt-get -y install golang-1.12 mingw-w64 - -ENV GOPATH=/go -ENV PATH=/usr/lib/go-1.12/bin:$PATH diff --git a/contrib/build b/contrib/build deleted file mode 100755 index dbf8970..0000000 --- a/contrib/build +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -docker build -t go-win . diff --git a/contrib/build-windows b/contrib/build-windows new file mode 100755 index 0000000..1fc16ac --- /dev/null +++ b/contrib/build-windows @@ -0,0 +1,27 @@ +#!/bin/bash + +set -e -o pipefail + +BUILDER_IMG="$(echo ' + +FROM debian:experimental + +RUN apt-get update -y && apt-get -y install golang-1.15 mingw-w64 +RUN apt-get install -y ca-certificates + +ENV GOPATH=/go +ENV PATH=/usr/lib/go-1.15/bin:$PATH + +' | docker build -q -)" + +docker run -it --rm -v "$(pwd)/..:/src" -w /src "${BUILDER_IMG}" bash -ec -o pipefail ' + +go generate +export GOOS=windows +export GOARCH=amd64 +export CC=x86_64-w64-mingw32-gcc +export CGO_ENABLED=1 +go build -tags prod -o runsheet-windows.exe +chown $(stat --printf "%u:%g" .) runsheet-windows.exe + +' diff --git a/go.mod b/go.mod index 6c7cd96..283ac9c 100644 --- a/go.mod +++ b/go.mod @@ -11,5 +11,7 @@ require ( github.com/lib/pq v1.2.0 github.com/looplab/tarjan v0.0.0-20161115091335-9cc6d6cebfb5 github.com/mattn/go-sqlite3 v1.11.0 + github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749 // indirect + github.com/shurcooL/vfsgen v0.0.0-20200824052919-0d455de96546 // indirect gopkg.in/goracle.v2 v2.19.0 ) diff --git a/go.sum b/go.sum index 0dd4e4e..d48abac 100644 --- a/go.sum +++ b/go.sum @@ -86,6 +86,10 @@ github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y8 github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= +github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749 h1:bUGsEnyNbVPw06Bs80sCeARAlK8lhwqGyi6UT8ymuGk= +github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg= +github.com/shurcooL/vfsgen v0.0.0-20200824052919-0d455de96546 h1:pXY9qYc/MP5zdvqWEUH6SjNiu7VhSjuVFTFiTcphaLU= +github.com/shurcooL/vfsgen v0.0.0-20200824052919-0d455de96546/go.mod h1:TrYk7fJVaAttu97ZZKrO9UbRa8izdowaMIZcxYMbVaw= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w=