1
0
mirror of https://github.com/rancher/rke.git synced 2025-08-31 14:36:32 +00:00

Add pre release notes with k8s versions included

This commit is contained in:
Sebastiaan van Steenis
2022-02-16 20:49:21 +01:00
parent a5cfbb3597
commit a95f2aa529
3 changed files with 40 additions and 2 deletions

View File

@@ -45,9 +45,11 @@ steps:
checksum:
- sha256
files:
- "build/bin/rke_*"
- "build/bin/rke*"
prerelease: true
title: "Pre-release ${DRONE_TAG}"
note: ./build/bin/rke-k8sversions.txt
overwrite: true
when:
instance:
include:
@@ -66,7 +68,7 @@ steps:
checksum:
- sha256
files:
- "build/bin/rke_*"
- "build/bin/rke*"
api_key:
from_secret: github_token
title: "Release ${DRONE_TAG}"

34
scripts/create-releasenote.sh Executable file
View File

@@ -0,0 +1,34 @@
#!/bin/bash
# This script will create a txt file with k8s versions which will be used as (pre) release decription by Drone
set -e -x
RELEASEFILE="./build/bin/rke-k8sversions.txt"
mkdir -p ./build/bin
echo "Creating ${RELEASEFILE}"
DEFAULT_VERSION=$(./bin/rke --quiet config --list-version)
if [ $? -ne 0 ]; then
echo "Non zero exit code while running 'rke config -l'"
exit 1
fi
DEFAULT_VERSION_FOUND="false"
echo "# RKE Kubernetes versions" > $RELEASEFILE
for VERSION in $(./bin/rke --quiet config --all --list-version | sort -V); do
if [ "$VERSION" == "$DEFAULT_VERSION" ]; then
echo "- \`${VERSION}\` (default)" >> $RELEASEFILE
DEFAULT_VERSION_FOUND="true"
else
echo "- \`${VERSION}\`" >> $RELEASEFILE
fi
done
if [ "$DEFAULT_VERSION_FOUND" == "false" ]; then
echo -e "\nNo default version found!" >> $RELEASEFILE
fi
echo "Done creating ${RELEASEFILE}"
cat $RELEASEFILE

View File

@@ -9,6 +9,8 @@ ARCH=${ARCH:-"amd64"}
SUFFIX=""
[ "${ARCH}" != "amd64" ] && SUFFIX="_${ARCH}"
./scripts/create-releasenote.sh
cd package
TAG=${TAG:-${VERSION}${SUFFIX}}