-
Notifications
You must be signed in to change notification settings - Fork 47
Add command to create releases. #129
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
⭐ |
This avoids double importing issues.
contentType := http.DetectContentType(content) | ||
|
||
fmt.Printf("-- Uploading %s to %s\n", contentType, uploadUrl.String()) | ||
request, err := http.NewRequest("POST", uploadUrl.String(), asset) |
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.
@technoweenie I'm having issues uploading the asset as the body of the request, it's probably something that I'm doing wrong.
- I pass the file as a body for the request, since it's an *io.Reader.
- The url where I send the request is something like this:
https://uploads.github.com/repos/calavera/testGoPack/releases/128568/assets?name=1.txt
- The content type is detected as
text/plain
which is correct.
The api gives me a status code 422, which is "Unprocessable entity".
Any recommendation?
@jingweno this is working pretty nicely now. It's a lot of code to review, so no rush. There are a bunch of testing releases in this repo: https://github.com/calavera/testGoPack/releases The most recents are https://github.com/calavera/testGoPack/releases/tag/v1.0.21 and https://github.com/calavera/testGoPack/releases/tag/v1.0.20 |
Removes duplicated test helper.
Wow, this looks awesome! 💯 Give me a day or two to play with it |
@@ -320,9 +320,11 @@ For more details, run `gh help alias`. | |||
|
|||
### gh release (beta) | |||
|
|||
$ gh release | |||
$ gh releases |
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.
What do you think of merging the list and the create? Say gh release
to list and gh release add
to create, by following the git convention
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.
That's a good idea. add
doesn't really sound right, maybe gh release create
? or is it too long? maybe I'm just over thinking.
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.
create
actually sounds more accurate. Good call
This is interesting. I just created a draft release with Is that normal? It may be a API bug or some behaviours I wasn't aware. The repo is here. |
Thanks for the review @jingweno, I'm going to address the issues today. I think the "untagged-..." name is right for drafts, the behavior is the same when you create a draft via the UI. |
@calavera Cool. Thanks for the clarification. Ya, I just realized it's the same thing I got from the UI. |
@calavera Thanks for the contributions! The PR in general looks great except for some minor issues. Let me know if you need any help |
* master: Gramma issue in README Bump homebrew-gh which fixes sha and download path Bump homebrew-gh submodule to 1.0.0 Bump version to v1.0.0 Make it explicit that multiple credentials are allowed Quote path Add link to available setting Add autoupdate setting to README Make sure we load the deprecated configuration and override it with the new one. Save the new config after assigning the credentials. Save the configuration with the new format when the deprecated one is detected. Update versions automatically when autoupdate is set to true.
@jingweno I did some progress with this PR, the only things missing to change are the argument validation and the command definition, I'm going to use I added a super simple progress indicator, what do you think? |
@calavera I just pulled down your changes and played with it. It looks so much better now! 🤘 |
@jingweno I'm not really sure if we should address the subcommands in this PR. After reading the arguments implementation I feel like I'd need to change quite a few things. What do you think about handling that in another PR? We could also solve other issues there too. For instance, the flags are positional, if you set flags after the arguments they are completely ignored. I think we could handle all the issues with args/flags parsing in a different issue/PR better. |
@calavera For sure, let's merge this in |
🆒 I'm merging this! |
Add command to create releases.
This PR adds a new command to create releases with gh.
It combines two steps in a single command.
Running
gh release v1.0.0
this command will perform two tasks:releases/v1.0.0
.The location of the assets can be modified using the flag
-a
.The flags
-p
and-d
can be passed to create a prerelease or a draft.This command will open EDITOR if there is no message or file to get the title and the body from.