New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
release: Fully migrate from hub to gh #8308
Conversation
0dc9ffb
to
9c5aefd
Compare
I finally decided to test these changes against a fork of the Kata repo in my own GH org (hence the first patch). https://github.com/groug-org/kata-containers I could successfully check that everything works as expected when releasing dummy versions in this repo :
groug-org#3
groug-org#13
groug-org#18
groug-org#19 |
We don't want to mess with the official repo when testing a change in the release scripts. Adapt `update-repository-version.sh` to be able to use an alternate repo just like `tag_repos.sh` already does. This means that the following command : $ OWNER="$SOME_ORG" ./update-repository-version.sh -p "$NEW_VERSION" "$BRANCH" will only create a PR in this repo : http://github.com/$SOME_ORG/kata-containers.git Signed-off-by: Greg Kurz <groug@kaod.org>
tools/packaging/scripts/lib.sh
Outdated
build_gh() { | ||
info "Get gh" | ||
|
||
if cmd=$(command -v gh); then | ||
gh_cli="${cmd}" | ||
return | ||
else | ||
gh_cli="${tmp_dir:-/tmp}/gh-cli" | ||
fi | ||
|
||
# FIXME: Install required go version ? | ||
local gh_repo="github.com/cli/cli" | ||
local gh_repo_dir="${GOPATH}/src/${gh_repo}" | ||
[ -d "${gh_repo_dir}" ] || git clone --quiet --depth 1 "https://${gh_repo}.git" "${gh_repo_dir}" | ||
pushd "${gh_repo_dir}" >>/dev/null | ||
git checkout trunk | ||
git pull | ||
make bin/gh && mv bin/gh "${gh_cli}" | ||
popd >>/dev/null | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need this?
gh provides binaries as part of its release, and those are already installed by default in the runners.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This script is supposed to only be run locally by the person doing the release, not by runners, right ? Or am I missing something ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now, yes. only running locally.
I have plans to expand this to be done automagically, hopefully.
Anyways, downloading the binary would be the way to go, and in the other comment you said you'd be addressing this, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switched to downloading the binary.
tools/packaging/release/tag_repos.sh
Outdated
@@ -150,9 +149,13 @@ tag_repos() { | |||
|
|||
push_tags() { | |||
info "Pushing tags to repos" | |||
build_hub | |||
build_gh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't easier to just download gh from https://github.com/cli/cli/releases/tag/v2.37.0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could avoid the problem of requiring a too recent golang to do the build indeed. I'll have a look.
If gh isn't installed already, download it from GitHub. Signed-off-by: Greg Kurz <groug@kaod.org>
The hub tool is deprecated. Convert this script to use the official GitHub CLI gh instead of hub. A couple of adjustments had to be made : - the notes.md temporary file is moved to ${tmp_dir} in order to silent gh, otherwise it complains about an untracked file, - title of a PR no longer goes to the notes.md file since gh requires the title to be passed with a dedicated --title option. Fixes kata-containers#8303 Signed-off-by: Greg Kurz <groug@kaod.org>
The hub tool is deprecated. Convert this script to use the official GitHub CLI gh instead of hub. A typical gh setup is able to access repos using HTTPS along with GitHub credentials. It is only needed to patch the remote url when using SSH. Signed-off-by: Greg Kurz <groug@kaod.org>
Not used anymore. Signed-off-by: Greg Kurz <groug@kaod.org>
This comment belongs to the hub tool that got sunset by 710eb8a. Just drop it. Signed-off-by: Greg Kurz <groug@kaod.org>
/test |
1 similar comment
/test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, thanks @gkurz!
The hub tool is deprecated. Convert the release scripts to use the official GitHub CLI gh instead.
Fixes #8303
EDIT: this also fixes this old issue
Fixes #3083
Same digits being used in both issue numbers is pure coincidence 馃槃
Signed-off-by: Greg Kurz groug@kaod.org