release: Add _upload_libseccomp_tarball()

As the name of the function says, it's responsible for uploading the
libseccomp source tarballs as par of our release process.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
This commit is contained in:
Fabiano Fidêncio
2024-02-23 20:01:23 +01:00
parent d517fa54ac
commit fd699625fe
2 changed files with 24 additions and 17 deletions

View File

@@ -94,6 +94,26 @@ function _upload_vendored_code_tarball()
gh release upload "${RELEASE_VERSION}" "${vendored_code_tarball}"
}
function _upload_libseccomp_tarball()
{
_check_required_env_var "GH_TOKEN"
[ -z "${RELEASE_VERSION}" ] && RELEASE_VERSION=$(cat "${repo_root_dir}/VERSION")
INSTALL_IN_GO_PATH=false ${repo_root_dir}/ci/install_yq.sh
versions_yaml="versions.yaml"
version=$(/usr/local/bin/yq read ${versions_yaml} "externals.libseccomp.version")
repo_url=$(/usr/local/bin/yq read ${versions_yaml} "externals.libseccomp.url")
download_url="${repo_url}releases/download/v${version}"
tarball="libseccomp-${version}.tar.gz"
asc="${tarball}.asc"
curl -sSLO "${download_url}/${tarball}"
curl -sSLO "${download_url}/${asc}"
gh release upload "${RELEASE_VERSION}" "${tarball}"
gh release upload "${RELEASE_VERSIOB}" "${asc}"
}
function main()
{
action="${1:-}"
@@ -103,6 +123,7 @@ function main()
upload-kata-static-tarball) _upload_kata_static_tarball ;;
upload-versions-yaml-file) _upload_versions_yaml_file ;;
upload-vendored-code-tarball) _upload_vendored_code_tarball ;;
upload-libseccomp-tarball) _upload_libseccomp_tarball ;;
*) >&2 _die "Invalid argument" ;;
esac
}