nikivi Posted July 6, 2017 Share Posted July 6, 2017 (edited) One thing that I really find annoying is that if I wanted to use @vitor's OneUpdater node to auto update my workflows, I have to put the workflow itself inside the repository. Not only that, I have to link this same new workflow in the updated release on GitHub repo of the workflow. The only problem is that is it so painful to do this. Ideally, if the workflow contains some code, I can write this code not in the alfred folder but write it elsewhere and either use this command if I am writing the workflow in Go or this script written by @deanishe. Is it possible to do this : 1. I have a workflow like this one which I just updated. 2. To release the update, I export it to my Desktop, go to releases on GitHub, write ver number + what was updated and attach the workflow binary 3. And OneUpdater or some other mechanism picks this release up and users get notified. Right now, it seems together with step 1 and 2, I have to export this workflow. Open the workflow directory in Alfred, put the workflow there and push that too. It's not horrible but it would be so much nicer if I didn't have to do that. I mean isn't that what releases are for? I have looked at nearly all workflows that use OneUpdater and they all link to a workflow attached to the repo itself. Can OneUpdater be augmented in some way to watch for new releases and pick an update if it sees 'latest' release being changed on GitHub? That would be so amazing. Although I understand if @vitor, doesn't want to update OneUpdater in this way since he doesn't use GitHub releases at all. I am not too programmer savvy still but I am thinking perhaps OneUpdater can watch a link like this : readonly workflow_url="https://github.com/nikitavoloboev/alfred-my-mind/releases/download/v1.0.1/nikivis.mind.alfredworkflow" and check if v1.0.1 numbers were updated. If they were it would notify the user and grab the latest release? Or there is some really easy solution to this that I don't see. Thank you a lot for any help on this. I would really appreciate it. Edited July 6, 2017 by nikivi Link to comment
vitor Posted July 6, 2017 Share Posted July 6, 2017 1 hour ago, nikivi said: if I wanted to use @vitor's OneUpdater node to auto update my workflows, I have to put the workflow itself inside the repository. Not only that, I have to link this same new workflow in the updated release on GitHub repo of the workflow. None of that is accurate. For one, I’m pretty sure you can automate and publish Github releases from the CLI (though I have never done so). But even if you just want to publish releases manually, OneUpdater has specific features for that. You can either: Update workflow_url to the new release URL every time. Takes some work and you can forget about it. Make workflow_url dynamic, by making it check the Workflow’s own version (OneUpdater itself does it). Then you just make sure your releases follow a predictable name with their version number. Pretty easy, and you just need to remember to be consistent. Set workflow_url to the Github releases page URL, and set workflow_type to page. That would be the method I’d use. New workflow versions aren’t automatically downloaded, but the user is still notified and redirected to the page to download the new version. Those features are explained right there in the first lines. The comments explain that in detail. 1 hour ago, nikivi said: Can OneUpdater be augmented in some way to watch for new releases and pick an update if it sees 'latest' release being changed on GitHub? That would be so amazing. That is unnecessary. The third point above already covers that. When I wrote OneUpdater I took into account people that use different methods than me. 1 hour ago, nikivi said: since he doesn't use GitHub releases at all. Not for Alfred Workflows, no, but I use it for other apps. 1 hour ago, nikivi said: readonly workflow_url="https://github.com/nikitavoloboev/alfred-my-mind/releases/download/v1.0.1/nikivis.mind.alfredworkflow" and check if v1.0.1 numbers were updated. If they were it would notify the user and grab the latest release? Or there is some really easy solution to this that I don't see. That’s pretty much how it works already. Except it does not download the compiled Workflow because that would be a waste of bandwidth. Instead, it just downloads what it needs to check the version (remote_info_plist). That’s way more efficient in every regard. Less code, less bandwidth, faster. The entirety of this post is about OneUpdater, so I don’t get why you didn’t just post the questions in its post. It would’ve been more efficient. More than half of your issues are already solved natively by OneUpdater, and the remainder isn’t even related to it. OneUpdater (like any auto-updater) makes auto-updates easier, it doesn’t try to solve how you release Workflows. That’s your job, as everyone has a different method. I have a bash function that I can run in any Workflow directory. When I do, it auto cleans it, packages it, updates it in my repo, and even copies the commit message ready to paste in the forum. deanishe 1 Link to comment
vitor Posted July 6, 2017 Share Posted July 6, 2017 For example, for your mindmaps Workflow, you’d do: readonly remote_info_plist="https://raw.githubusercontent.com/nikitavoloboev/alfred-learn-anything/master/info.plist" readonly workflow_url="https://github.com/nikitavoloboev/alfred-learn-anything/releases" readonly workflow_type='page' readonly frequency_check='15' Done. Now you never have to touch it again. When there’s an update, users will be notified and the releases page will open in the browser. nikivi 1 Link to comment
nikivi Posted July 6, 2017 Author Share Posted July 6, 2017 (edited) Oh I see now. This makes a lot more sense. Thank you a lot for both your reply and this awesome tool. However I did not see any comments about 'page' option in the the OneUpdater object itself : And from reading OneUpdater forum thread I did not get that 'page' option would work with GitHub releases. This does make a lot more sense now, I am quite happy that I can finally have all my few workflows be auto updating. I posted this here and not in OneUpdater as I just wanted to hear how other people release their workflows and perhaps share their scripts they use to make this process easier. Edited July 6, 2017 by nikivi Link to comment
deanishe Posted July 6, 2017 Share Posted July 6, 2017 8 minutes ago, vitor said: Those features are explained right there in the first lines. You know Niki never reads the docs. He spends 20 minutes writing a post instead of 2 reading the docs/other posts in the thread. 1 hour ago, nikivi said: readonly workflow_url="https://github.com/nikitavoloboev/alfred-my-mind/releases/download/v1.0.1/nikivis.mind.alfredworkflow" and check if v1.0.1 numbers were updated. You haven't thought that through at all. It's a hardcoded URL. It's never going to change. If you want to download updates from GitHub releases, it's a more complicated process. You need code that can parse the JSON response from the GitHub API and that understands semantic version numbers (or whatever scheme you're using). 1 hour ago, nikivi said: it so painful to do this. That strikes me as an exaggeration, but if you find it such a chore, why don't you rip the update code out of Alfred-Workflow (which uses GitHub releases), and build an alternative to OneUpdater that pulls its updates from GitHub releases? vitor 1 Link to comment
vitor Posted July 6, 2017 Share Posted July 6, 2017 17 minutes ago, nikivi said: However I did not see any comments about 'page' option in the the OneUpdater object itself You either deleted them, copied the wrong node (non-pink one), or copied the node from somewhere else other than the OneUpdater workflow (like one of mine — I delete the comments). Link to comment
nikivi Posted July 6, 2017 Author Share Posted July 6, 2017 (edited) Yeah, I think I copied OneUpdater from one of your workflows and it did not have these comments. 29 minutes ago, deanishe said: That strikes me as an exaggeration, but if you find it such a chore, why don't you rip the update code out of Alfred-Workflow (which uses GitHub releases), and build an alternative to OneUpdater that pulls its updates from GitHub releases? Actually now that I realised I can do this already with OneUpdater, I don't actually need a direct download. A link to releases is great too as it will state changes made to the workflow in there. But I might try to write something like this in the future. I stumbled on goreleaser recently which I think is really awesome for automating releases. First I want to make and release this workflow, I am struggling to understand how to action on items that are put into Feedback structs in your awgo library. But I can do this, with a little bit more reading and reverse engineering. Sadly there is not many workflows made in Go and especially your library and the ones that are made I found to be quite hard to understand. I also don't want to use you alfred workflow library as I really want to learn Go and I quite like the language. Sorry for appearing to not read the docs, I actually really tried to find the answer on my own. Edited July 6, 2017 by nikivi Link to comment
deanishe Posted July 7, 2017 Share Posted July 7, 2017 15 hours ago, nikivi said: I also don't want to use you alfred workflow library I wasn't saying you should use the library. I was saying you could rip the GitHub JSON & semantic version parsing code out of it to build a OneUpdater-like updater (i.e. a single node that can be copied into any workflow) that uses GitHub releases. 15 hours ago, nikivi said: I really want to learn Go My Go library has the same feature. You can't use Go to build a OneUpdater replacement, though. 15 hours ago, nikivi said: not many workflows made in Go and especially your library My library hasn't been released. It's a prototype that I'm rewriting as I get more familiar with idiomatic Go. I don't think I've released a workflow written with it, either. 15 hours ago, nikivi said: the ones that are made I found to be quite hard to understand Go isn't aimed at beginners. Most code/docs assume quite a lot of knowledge. Link to comment
nikivi Posted July 7, 2017 Author Share Posted July 7, 2017 (edited) 1 hour ago, deanishe said: Go isn't aimed at beginners. Most code/docs assume quite a lot of knowledge. Yeah I understand that. Still though it's something I do want to learn as I really love the tooling around it. Like gofmt for example. I also like how Go enforces you to write in a certain style. In python you can write however you want and if you are beginner, it's often not such a huge advantage for you. 1 hour ago, deanishe said: My library hasn't been released. It's a prototype that I'm rewriting as I get more familiar with idiomatic Go. I don't think I've released a workflow written with it, either. I am curious why don't you release your Safari Assistant workflow? I use it daily and it is amazing. I mean you kind of have released it on your self hosted git but not officially. Edited July 7, 2017 by nikivi Link to comment
deanishe Posted July 7, 2017 Share Posted July 7, 2017 29 minutes ago, nikivi said: I also like how Go enforces you to write in a certain style. 30 minutes ago, nikivi said: In python you can write however you want and if you are beginner, it's often not such a huge advantage for you. No, you really can't. Indentation is semantic, so you have to indent your code properly. There are no anonymous functions or cryptic, Perl-/Ruby-like shorthand. The language itself lets you do crazy things if you really must, but it makes hard-to-read code more difficult to write than easy-to-read code. There are plenty of linters that show warnings if your code isn't PEP-8 compliant. They just don't rewrite the code for you, like gofmt does. The benefit of gofmt isn't to help write code, it's to help read other people's. If you don't even format your code properly, you should stop coding because you are definitely doing far worse things. nikivi 1 Link to comment
dfay Posted July 7, 2017 Share Posted July 7, 2017 (edited) Quote You know Niki never reads the docs. He spends 20 minutes writing a post instead of 2 reading the docs/other posts in the thread. And we admire @deanishe for his patience in replying! Edited July 7, 2017 by dfay Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now