From 7dddb91504c48260cc6b3f10621f4216be41338e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20M=C3=BCller=20=28ChaoticByte=29?= Date: Mon, 16 Oct 2023 17:53:55 +0200 Subject: [PATCH] Added build script that cross-compiles, set minimal go version to 1.21 and updated README --- README.md | 7 +++++-- build.sh | 15 +++++++++++++++ go.mod | 2 +- 3 files changed, 21 insertions(+), 3 deletions(-) create mode 100755 build.sh diff --git a/README.md b/README.md index 600c717..e584424 100644 --- a/README.md +++ b/README.md @@ -14,9 +14,12 @@ This software queries the APIs of these services for new security notices and se This Software only supports Linux. -# Usage +# Build -After building the application using `go build`, run +To cross-compile the software for `i386`, `amd64`, `arm` and `arm64`, run `build.sh`. +You need a go version >= 1.21 and git. + +# Usage ```bash ./wid-notifier diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..7ac90ca --- /dev/null +++ b/build.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +VERSION=$(git describe --tags) + +# i386 +GOOS=linux GOARCH=386 go build -o dist/wid-notifier_${VERSION}_linux_i386 + +# amd64 +GOOS=linux GOARCH=amd64 go build -o dist/wid-notifier_${VERSION}_linux_amd64 + +# arm +GOOS=linux GOARCH=arm go build -o dist/wid-notifier_${VERSION}_linux_arm + +# arm64 +GOOS=linux GOARCH=arm64 go build -o dist/wid-notifier_${VERSION}_linux_arm64 diff --git a/go.mod b/go.mod index 5584a12..171c292 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,3 @@ module github.com/ChaoticByte/wid-notifier -go 1.21.1 +go 1.21