-
Notifications
You must be signed in to change notification settings - Fork 222
Expand file tree
/
Copy pathrelease.sh
More file actions
executable file
·53 lines (46 loc) · 2.09 KB
/
Copy pathrelease.sh
File metadata and controls
executable file
·53 lines (46 loc) · 2.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/usr/bin/env bash
# Copyright 2019 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
ORG_NAME=knative
VALIDATION_TESTS="make test"
source "$(go run knative.dev/hack/cmd/script release.sh)"
function build_release() {
echo "🚧 🐧 Building cross platform binaries: Linux 🐧 (amd64 / arm64 / ppc64le / s390x), MacOS 🍏, and Windows 🎠"
local go_module_version
local knative_version
if (( TAG_RELEASE )); then
knative_version="${TAG}"
# Check if TAG is a nightly date-based tag (vYYYYMMDD-hash) vs semver (knative-vX.Y.Z)
if [[ "${TAG}" =~ ^v[0-9]{8}- ]]; then
# Nightly build: use TAG directly as version
go_module_version="${TAG}"
else
# Release build: convert knative version to go module version
go_module_version="v0.$(( $(minor_version "$TAG") + 27 )).$(patch_version "$TAG")"
fi
else
knative_version="$(git describe --tags --match 'knative-*' 2>/dev/null || git rev-parse --short HEAD)"
go_module_version="$(git describe --tags --match 'v*' 2>/dev/null || git rev-parse --short HEAD)"
fi
VERS="${go_module_version}" KVER="${knative_version}" make cross-platform
ARTIFACTS_TO_PUBLISH="func_darwin_amd64 func_darwin_arm64 func_linux_amd64 func_linux_arm64 func_linux_ppc64le func_linux_s390x func_windows_amd64.exe"
ARTIFACTS_TO_PUBLISH="${ARTIFACTS_TO_PUBLISH}"
sha256sum ${ARTIFACTS_TO_PUBLISH} > checksums.txt
ARTIFACTS_TO_PUBLISH="${ARTIFACTS_TO_PUBLISH} checksums.txt"
echo "🧮 Checksum:"
cat checksums.txt
}
main $@