Added build script that cross-compiles, set minimal go version to 1.21 and updated README

This commit is contained in:
Julian Müller (ChaoticByte) 2023-10-16 17:53:55 +02:00
parent d608af2a0d
commit 7dddb91504
3 changed files with 21 additions and 3 deletions

View file

@ -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 <configfile>

15
build.sh Executable file
View file

@ -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

2
go.mod
View file

@ -1,3 +1,3 @@
module github.com/ChaoticByte/wid-notifier
go 1.21.1
go 1.21