-
Notifications
You must be signed in to change notification settings - Fork 39
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
Fix brew-update util, and add CI #207
base: devel
Are you sure you want to change the base?
Conversation
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.
@danielbayley Thanks so much for this effort. Like so many things with YS I have wanted to (find the time to) encode more automations with GHA.
Looking at your workflow YAML it is obvious that you know what you are doing at multiple levels: GHA, YAML and shell commands. (I'm very particular about YAML and shell so good to see!)
I don't see anything to comment on in the workflow yaml.
I have a few comments for the brew-update ys script...
Also, let me know if you are up for helping with the overall release process.
|
||
defn main(version): | ||
check-version: version | ||
download-releases: version | ||
update-brew: version | ||
|
||
defn sha256sum(file): |
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.
I love to see you refactoring with YS code!
util/brew-update
Outdated
res =: sh("curl --silent --location $url --output $file") | ||
when res.exit:N.?: | ||
die: "Download of '$url' failed:\n$(res.err)" |
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.
YS has std/curl
so you could also replace this with
spit file: curl(url)
I wrote this script pretty quickly so didn't think of that before.
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.
YS has
std/curl
so you could also replace this withspit file: curl(url)
Cool. The thing I didn't know about was spit
, which is not the most intuative method name… So I missed it in the docs, searching instead for write
/file
or similar :)
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.
The spit
function comes from straight from clojure.core
$ ys -pe spit
#object[clojure.core$spit 0x2d4edc62 "clojure.core$spit@2d4edc62"]
it's supposed to be the opposite of slurp
. I really don't like the name spit
for that. read
and write
might be better. Any ideas?
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.
it's supposed to be the opposite of
slurp
. I really don't like the namespit
for that.read
andwrite
might be better. Any ideas?
I see, makes more sense in that case. Well since they're in Clojure core, they should keep that naming for users used to that convention, but also maybe add read
and write
aliases for everyone else…
util/brew-update
Outdated
@@ -62,7 +69,7 @@ defn releases(version):: | |||
MAC_INT:: "ys-${version}-macos-x64.tar.xz" | |||
|
|||
defn check-version(version): | |||
when version !~ /^0\.1\.\d+$/: | |||
when version !~ /^\d(\.\d+){2}$/: |
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.
Let's not generalize this quite yet. I purposefully coded it that way, because I wanted to remember to circle back here when I got to a major release.
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.
Maybe I need to add more comments in general :)
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.
Ok, revert
ed…
Note
For future reference, the general pattern here is missing a +
, it should actually be /^\d+(\.\d+){2}$/
.
I'm also very particular, about everything! @ingydotnet As you mentioned in #205…
If/once you have an LSP up and running, it should be straightforward enough to build a linter to enforce these kind of formatting concerns on top of it… |
@danielbayley Sorry about the delay. I'll try to find time this weekend to get to the CI part. |
No worries.
Yeah, it was broken otherwise. Maybe there is a way around it, if you want to insist on ssh… But that is what worked for me. |
I have some questions about brew. My current process is to run my release process (run Then I run I'd like to automate it all eventually. I don't know brew very well, but I have used it over the years. When I set this up I learned about using I did the 0.1.88 update using your changes to from this PR but I just tested this on a mac and I get this:
Can you figure out what happened there? Also open to suggestions about how to proceed. Also I have another way to install things that I want to ask you about. |
@danielbayley This is also interesting...
I'd like things to work such that once people have a We'll have to think about how this works with brew and other pkg sources...
|
YAMLScript
Ideally, the
util/brew-update
script would be replaced withbrew
bump-formula-pr
, but this doesn't currently seem to work properly with formulae containing multipleurl
s andsha256
sums. Fixing that will be yet another PR, over on Homebrew…CI
The workflow will run on every release, and uses
brew
livecheck
to only update if the release SemVer tag is newer than the latest formula. You can preview the CI in action on my fork…The workflow just requires an organisation
ACCESS_TOKEN
…See also #205 and #197 (comment).