Updated build script to use xgo and support cgo. Closes #54

This commit is contained in:
Gabe Kangas
2020-07-12 17:58:34 -07:00
parent 965c213d59
commit d8960f420a
3 changed files with 7 additions and 2 deletions

View File

@@ -49,9 +49,11 @@ build() {
cp -R static/ dist/${NAME}/static
cp README.md dist/${NAME}
env CGO_ENABLED=0 GOOS=$OS GOARCH=$ARCH go build -ldflags "-X main.GitCommit=$GIT_COMMIT -X main.BuildVersion=$VERSION -X main.BuildType=$NAME" -a -o dist/$NAME/owncast
pushd dist/${NAME} >> /dev/null
CGO_ENABLED=1 ~/go/bin/xgo -ldflags "-X main.GitCommit=${GIT_COMMIT} -X main.BuildVersion=${VERSION} -X main.BuildType=${NAME}" -targets "${OS}/${ARCH}" github.com/gabek/owncast
mv owncast-*-${ARCH} owncast
zip -r -q -8 ../owncast-$NAME-$VERSION.zip .
popd >> /dev/null