From d3d4dbfe91db823eb056defd3a7da074414830f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roland=20Hu=C3=9F?= Date: Thu, 25 Feb 2021 07:43:47 +0100 Subject: [PATCH] chore: Add missing release.sh (#45) --- hack/release.sh | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100755 hack/release.sh diff --git a/hack/release.sh b/hack/release.sh new file mode 100755 index 000000000..0b9e52141 --- /dev/null +++ b/hack/release.sh @@ -0,0 +1,46 @@ +#!/usr/bin/env bash + +# Copyright 2020 The Knative Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Documentation about this script and how to use it can be found +# at https://github.com/knative/hack + +source $(dirname $0)/../vendor/knative.dev/hack/release.sh + +PLUGIN="kn-admin" + +function build_release() { + export GO111MODULE=on + export CGO_ENABLED=0 + echo "🚧 🐧 Building for Linux (amd64)" + GOOS=linux GOARCH=amd64 go build -mod=vendor -o ./${PLUGIN}-linux-amd64 ./cmd/... + echo "🚧 💪 Building for Linux (arm64)" + GOOS=linux GOARCH=arm64 go build -mod=vendor -o ./${PLUGIN}-linux-arm64 ./cmd/... + echo "🚧 🍏 Building for macOS" + GOOS=darwin GOARCH=amd64 go build -mod=vendor -o ./${PLUGIN}-darwin-amd64 ./cmd/... + echo "🚧 🎠 Building for Windows" + GOOS=windows GOARCH=amd64 go build -mod=vendor -o ./${PLUGIN}-windows-amd64.exe ./cmd/... + echo "🚧 Z Building for Linux(s390x)" + GOOS=linux GOARCH=s390x go build -mod=vendor -o ./${PLUGIN}-linux-s390x ./cmd/... + echo "🚧 P Building for Linux (ppc64le)" + GOOS=linux GOARCH=ppc64le go build -mod=vendor -o ./${PLUGIN}-linux-ppc64le ./cmd/... + ARTIFACTS_TO_PUBLISH="${PLUGIN}-darwin-amd64 ${PLUGIN}-linux-amd64 ${PLUGIN}-linux-arm64 ${PLUGIN}-windows-amd64.exe ${PLUGIN}-linux-s390x ${PLUGIN}-linux-ppc64le" + sha256sum ${ARTIFACTS_TO_PUBLISH} > checksums.txt + ARTIFACTS_TO_PUBLISH="${ARTIFACTS_TO_PUBLISH} checksums.txt" + echo "🧮 Checksum:" + cat checksums.txt +} + +main $@