Add the source release launcher
This commit is contained in:
29
scripts/release
Executable file
29
scripts/release
Executable file
@@ -0,0 +1,29 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
if [ "$#" -ne 1 ]; then
|
||||
printf '%s\n' 'usage: ./scripts/release VERSION' >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
release_version=$1
|
||||
commandkit_root=$(CDPATH= cd "$(dirname "$0")/.." && pwd)
|
||||
CDPATH= cd "$commandkit_root"
|
||||
|
||||
mkdir -p .releasekit/bin
|
||||
|
||||
commandkit_host_os=$(GOWORK=off GOTOOLCHAIN=local go env GOHOSTOS)
|
||||
commandkit_host_arch=$(GOWORK=off GOTOOLCHAIN=local go env GOHOSTARCH)
|
||||
GOOS="$commandkit_host_os" \
|
||||
GOARCH="$commandkit_host_arch" \
|
||||
GOWORK=off \
|
||||
GOTOOLCHAIN=local \
|
||||
go build \
|
||||
-mod=readonly \
|
||||
-o "$commandkit_root/.releasekit/bin/releasekit" \
|
||||
gitea.maximumdirect.net/eric/ReleaseKit/cmd/releasekit
|
||||
|
||||
exec "$commandkit_root/.releasekit/bin/releasekit" publish \
|
||||
--repo "$commandkit_root" \
|
||||
--config "$commandkit_root/releasekit.json" \
|
||||
"$release_version"
|
||||
Reference in New Issue
Block a user