mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-10-21 20:08:54 +00:00
snap: add GH actions jobs to release the snap package
Use Github actions to build and release the snap package automatically when a new tag is pushed. fixes #1006 Signed-off-by: Julio Montes <julio.montes@intel.com>
This commit is contained in:
@@ -21,20 +21,10 @@ parts:
|
||||
version="9999"
|
||||
kata_url="https://github.com/kata-containers/kata-containers"
|
||||
|
||||
image_info="${SNAPCRAFT_IMAGE_INFO:-}"
|
||||
snap_env="$(echo "${image_info}" | egrep -o "build_url.*" | egrep -o "snap.*build" | cut -d/ -f2)"
|
||||
|
||||
case "${snap_env}" in
|
||||
stable)
|
||||
# Get the latest stable version
|
||||
version=$(git ls-remote --tags ${kata_url} | egrep -o "refs.*" | egrep -v "\-alpha|\-rc|{}" | egrep -o "[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+" | sort -V -r | head -1)
|
||||
git checkout ${version}
|
||||
;;
|
||||
|
||||
*-dev)
|
||||
version="${snap_env}"
|
||||
;;
|
||||
esac
|
||||
if echo "${GITHUB_REF}" | grep -q -E "^refs/tags"; then
|
||||
version=$(echo ${GITHUB_REF} | cut -d/ -f3)
|
||||
git checkout ${version}
|
||||
fi
|
||||
|
||||
snapcraftctl set-grade "stable"
|
||||
snapcraftctl set-version "${version}"
|
||||
|
||||
Reference in New Issue
Block a user