Merge pull request #1271 from devimc/2021-01-14/stable-2.0/fixSnap

[backport] snap: tag yq version
This commit is contained in:
Fabiano Fidêncio 2021-01-14 22:41:56 +01:00 committed by GitHub
commit 9820459a0f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -57,15 +57,10 @@ parts:
*) echo "unsupported architecture: $(uname -m)"; exit 1;;
esac
# Workaround to get latest release from github (to not use github token).
# Get the redirection to latest release on github.
yq_latest_url=$(curl -Ls -o /dev/null -w %{url_effective} "https://${yq_pkg}/releases/latest")
# The redirected url should include the latest release version
# https://github.com/mikefarah/yq/releases/tag/<VERSION-HERE>
yq_version=$(basename "${yq_latest_url}")
yq_version=3.4.1
yq_url="https://${yq_pkg}/releases/download/${yq_version}/yq_${goos}_${goarch}"
curl -o "${yq_path}" -LSsf ${yq_url}
chmod +x ${yq_path}
curl -o "${yq_path}" -LSsf "${yq_url}"
chmod +x "${yq_path}"
kata_dir=gopath/src/github.com/${SNAPCRAFT_PROJECT_NAME}/${SNAPCRAFT_PROJECT_NAME}
version="$(${yq_path} r ${kata_dir}/versions.yaml languages.golang.meta.newest-version)"