Conversation
|
Ignore all this, I solved it in the comment below. |
|
Turns out it was go module related. I needed to make goreleaser use go v1.13. The action seems to work now, but I have no idea where the release it put! |
mislav
left a comment
There was a problem hiding this comment.
This is how hub does it: https://github.com/github/hub/blob/master/script/cross-compile
That defines the build matrix, then package creates the tarballs and github-release uses hub release create to attach assets to a new release.
If we wanted to use Actions and skip goreleaser (in case we don't manage to figure out how it works; in my mind it looks slightly over-engineered for our needs), we could potentially create a release and attach assets using Octokit https://octokit.github.io/rest.js/#octokit-routes-repos-upload-release-asset
.github/workflows/releases.yml
Outdated
| on: | ||
| push: | ||
| branches: | ||
| - "!*" |
There was a problem hiding this comment.
Is this branches part necessary? We can only leave tags if we want to build only on v* tagged releases
There was a problem hiding this comment.
Turns out the tutorial I read was wrong and we DON'T need the branches filter!
|
I'm still working on this PR.
goreleaser is over-engineered for what we need, but it also leaves a pretty tiny footprint on our project (a github action and a .goreleaser.yml file). I'm ok with using it for now because it does a lot of stuff automatically for us and it will be easy to swap out if we decide not to use it in the future. All that being said, I want to though goreleaser in off a bridge because it works perfectly except I can't get it to automatically update the brew formula. I'm still trying to figure out why that is, hopefully I will solve it in my dreams tonight. |
|
@probablycorey You can use this to update the Homebrew formula, by yours truly https://github.com/marketplace/actions/bump-homebrew-formula 💖 |
|
Automating our build process isn’t too difficult. But it turns out automating the install process IS difficult! Here are the options we have and why each of them stink in their own special way.
Based on these I'm going to start working on the |
|
@mislav I think this is finally ready to look at with you. If we like this, then we need to do three things.
Since this is installing a binary asset, I wasn't sure how to make your bump-homebrew-formula-action setup work, so I want to check in with you about that. |
| filters: | ||
| exclude: | ||
| - "^docs:" | ||
| - "^test:" |
There was a problem hiding this comment.
We may want to tell gorelaser to build this as production so it uses our production oauth app.
|
This works, I tested it out by creating this tag https://github.com/github/gh-cli/releases/tag/v0.0.114 and a release was created, binaries built, binaries copied to https://github.com/probablycorey/homebrew-gghh/releases, and the brew formula was updated. Some things I did after talking with @mislav The releases are still going to probablycorey/homebrew-gghh. I'm fine with moving to a more official repo now, or we can do that in another PR. I think reusing the |
|
Re: race conditions: the only way to create a Release with assets is to first create a Release (1 API call) and then attach assets to it one by one (N API calls). This process can be seen in goreleaser here. So if you have an Action that is triggered on
This problem is not very likely to bite us since assets typically upload faster than Actions spins up a job. I just wanted us to be aware of this in case Actions runs start being more efficient and we see some oddities down the line.
That makes sense for me too! Thanks for all the hard work on this 👍 |
|
It works, it's on |
|
I've taken this and ran with it. Goreleaser:
copy-release-to-another-repo:
|
The download URL is a public resource
Updating pr, Fixed output comparison
This PR sets us up to use https://goreleaser.com.
I used github actions to call goreleaser to build the binaries.
It seems to be working well, but it doesn't create the release. I'm guessing the release isn't showing up because this is a PR and not on master, but I need to verify that.I've modified the action so it only will create a release when a new tag is pushed. So I think the pattern goes like this.git tag -a v0.0.2 -m "v0.0.2" && git push origin v0.0.2Next up I'm going to look at hub's install script, make a curl style install script, and then ping security to learn why this was such a bad idea.