2020-05-12 05:08:22 +08:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
# Downloads the release artifacts from CI for the current
|
|
|
|
# commit and then uploads them to the release with the version
|
|
|
|
# in package.json.
|
|
|
|
# You will need $GITHUB_TOKEN set.
|
|
|
|
|
|
|
|
main() {
|
|
|
|
cd "$(dirname "$0")/../.."
|
|
|
|
source ./ci/lib.sh
|
2022-03-18 02:52:39 +08:00
|
|
|
source ./ci/steps/steps-lib.sh
|
|
|
|
|
|
|
|
# NOTE@jsjoeio - only needed if we use the download_artifact
|
|
|
|
# because we talk to the GitHub API.
|
|
|
|
# Needed to use GitHub API
|
|
|
|
if ! is_env_var_set "GITHUB_TOKEN"; then
|
|
|
|
echo "GITHUB_TOKEN is not set. Cannot download npm release-packages without GitHub credentials."
|
|
|
|
exit 1
|
|
|
|
fi
|
2020-05-12 05:08:22 +08:00
|
|
|
|
|
|
|
download_artifact release-packages ./release-packages
|
2020-10-12 14:09:48 +08:00
|
|
|
local assets=(./release-packages/code-server*"$VERSION"*{.tar.gz,.deb,.rpm})
|
2021-05-11 05:24:13 +08:00
|
|
|
|
2021-12-16 04:11:35 +08:00
|
|
|
EDITOR=true gh release upload "v$VERSION" "${assets[@]}" --clobber
|
2020-05-12 05:08:22 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
main "$@"
|