How to release go binary to github personal repo

I made a hack change in ko and would like to install my modified version with go get (I can’t just build locally because eventually it needs to go into a Dockerfile). Currently I put a hack release in

github.com/cathyzhyi/ko/releases/tag/v1.9.8 

and tried with

go get -v  github.com/cathyzhyi/ko/cmd/ko@v1.9.8 

However, seems go get can’t find the binary I uploaded but still look for the official release. The output is the following

go: found github.com/cathyzhyi/ko/cmd/ko in github.com/cathyzhyi/ko v1.9.8
go: finding module for package github.com/google/ko/pkg/commands
go: found github.com/google/ko/pkg/commands in github.com/google/ko v0.6.0

The changes I made are here https://github.com/cathyzhyi/ko/commit/4570765c7eff6a3c5ad425a577d7cc4169c0be05
The package name in go.mod is updated to github.com/cathyzhyi/ko
How can I get go get to download my version of ko? I think I need to upload the binary to a specific location that go get can find.

I think you need to change the package name in the go.mod file.

do you mean something like this?

Can you work outside of Dockerfile (to me, a kind of release manager) for the time being? To reduce debugging considerations.

If you pull from here: https://github.com/cathyzhyi/ko, yes! Or you can use relative pathing in go.mod and point it to a local copy of the cathyzhyi/ko. Something like:

replace gitlab.com/google/ko => ../cathyzhyi/ko

before the require clauses.

1 Like

Thanks for the help! I think I didn’t make my question clear though. I was trying to release the ko binary to github so that a container can use go get to install it.
I find a much simpler way to do it by just using wget to download the modified ko binary.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.