chore: add release script
This commit is contained in:
parent
3794ff3154
commit
23ae0769e3
2
.gitignore
vendored
2
.gitignore
vendored
@ -1 +1,3 @@
|
|||||||
.idea
|
.idea
|
||||||
|
|
||||||
|
/dist
|
||||||
|
32
misc/release.sh
Executable file
32
misc/release.sh
Executable file
@ -0,0 +1,32 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
PLATFORMS=(
|
||||||
|
"linux/amd64"
|
||||||
|
"linux/arm64"
|
||||||
|
"darwin/amd64"
|
||||||
|
"darwin/arm64"
|
||||||
|
"windows/amd64"
|
||||||
|
"windows/386"
|
||||||
|
)
|
||||||
|
|
||||||
|
DEST_DIR=${DEST_DIR:-"dist"}
|
||||||
|
|
||||||
|
for PLATFORM in "${PLATFORMS[@]}"; do
|
||||||
|
GOOS=${PLATFORM%/*}
|
||||||
|
GOARCH=${PLATFORM#*/}
|
||||||
|
echo "Building for $GOOS/$GOARCH"
|
||||||
|
|
||||||
|
FILENAME="um-$GOOS-$GOARCH"
|
||||||
|
if [ "$GOOS" = "windows" ]; then
|
||||||
|
FILENAME="$FILENAME.exe"
|
||||||
|
fi
|
||||||
|
|
||||||
|
GOOS=$GOOS GOARCH=$GOARCH go build -v \
|
||||||
|
-o "${DEST_DIR}/${FILENAME}" \
|
||||||
|
-ldflags "-s -w -X main.AppVersion=$(git describe --tags --always --dirty)" \
|
||||||
|
./cmd/um
|
||||||
|
done
|
||||||
|
|
||||||
|
cd "$DEST_DIR"
|
||||||
|
sha256sum um-* > sha256sums.txt
|
Loading…
Reference in New Issue
Block a user