Jump to content

Advice on structuring my Github repos?


Recommended Posts

So it now seems like I'm going to be sharing/publishing several Alfred Themes and Workflows over time... (woohoo!).

 

So far I've preferred to keep all of my themes and workflows in one master directory (probably because I saw someone else do this) but now I'm thinking (especially with how OneUpdater and @deanishe's Self-updating seem to work) that I should really migrate each theme and workflow into their own repos under my account. 

 

If I'm going to go down this path (with a key motivator being the ability to add auto-updating to my Workflows), are there any other suggestions or recommendations for how I set up my GitHub repos, including handling Releases and Tags?

 

Thanks!

Link to post

OneUpdater doesn't care how you structure your repos (Vítor keeps all his workflow in one repo), or even if the workflow is in a repo.

 

My updaters require one workflow per repo and the use of releases. (Except the metadata.json-based one in the Go library.)

 

Your repo structure looks absolutely fine and should work with OneUpdater no problem.

Edited by deanishe
An "e"
Link to post

I do both, small workflows in one mono repo (https://github.com/nikitavoloboev/small-workflows) updated with OneUpdater. Workflows with more code are updated with deanishe library https://github.com/deanishe/awgo which is the go version of his python library (and shared either in small workflows or as a separate repo).

 

I like this structure as there is too much friction I feel in sharing a small workflow by creating a new github repo every time.

 

One other thing that's useful to know is how to symlink workflows

Edited by nikivi
Link to post

Cool, thanks guys. I think I will switch to moving my larger individual "toolkits" and themes into individual repos so there's a clearer separation of issues, releases, and linkability. I'll keep my /alfred-app directory for my GitHub Pages though.

 

@nikivi thanks for your tips and resources...! I still want to learn more about your Web Searches workflow and writing Workflows in GO. Maybe I'll get started on that next week!

Link to post
1 hour ago, chris said:

writing Workflows in GO

 

I want to do more screencasting and learning materials around awgo as it's super cool library.

 

@deanisheIs there a doc I can see on how I can make developing workflows with AwGo nicer. I can't run the binary straight away so have to do it through debugger but that has font size that makes it impossible to read. 😞

 

Would be nice if there was some awgo function I can call debug() and it would figure out the weird things for me as I run it inside Alfred workflow. ❤️

Edited by nikivi
Link to post
54 minutes ago, nikivi said:

I can't run the binary straight away so have to do it through debugger but that has font size that makes it impossible to read.

 

Then open the log file in your editor instead.

 

If you want to be able to run a workflow binary in a shell, then you can modify the the env file from one of my workflows, which sets all the relevant Alfred variables to allow an AwGo binary to run in a shell.

 

I use zsh-autoenv, so that’s how I normally source the env file.

 

47 minutes ago, nikivi said:

the weird things

 

What are "the weird things"?

Link to post
3 minutes ago, deanishe said:

the weird things

 

The need for the .env file. I kind of get it but it's not mentioned anywhere in awgo readme. And I do wonder what is your preferred way of developing and looking at debugger logs. 

Edited by nikivi
Link to post
5 minutes ago, nikivi said:

Maybe I misunderstand the contents but I wonder if it can be replicated as part of `wf.DebugMode()` call to source this env.

 

That doesn’t make any sense. If you source a script that exports environment variables in a child process, those variables only exist in the child process.

Link to post

~/src/extensions/alfred/alfred-my-mind master*
❯ source .env                           
Print: Entry, ":bundleid", Does Not Exist
Print: Entry, ":version", Does Not Exist
Print: Entry, ":name", Does Not Exist
Print: Entry, ":variables:USER_ID", Does Not Exist

Link to post
9 minutes ago, nikivi said:

I kind of get it but it's not mentioned anywhere in awgo readme.

 

That isn't an appropriate place to describe my personal preferred method of building workflows.

 

8 minutes ago, nikivi said:

Is there a doc somewhere on how to do it?

 

You're asking me for docs on how to open a file in your editor?

 

11 minutes ago, nikivi said:

open Console and find Alfred or something but not sure.

 

Your editor. Console's font is no bigger than Alfred's debugger's.

Link to post

appropriate place to describe my personal preferred method of building workflows

 

True. But as a reference to an external place like a wiki entry maybe super beneficial. I plan to do it once I figure this issue out.
 

Don't take any of it as criticism. I just think more generally a screencast of someone developing a Go workflow with AwGo with 'proper' dev enviroment for fast feedback (modd or watchexec thing) will go along way.

 

Edited by nikivi
Link to post

I plan to release such a video once I figure out how to not look at Alfred debugger.

And funny thing is I now there is a way to do it as I did it before, just don't remember how.. Since then I document everything. 

Edited by nikivi
Link to post
4 minutes ago, nikivi said:

I need the location of the file to open it.

 

It's in the workflow's cache directory. Where it's always been.

 

8 minutes ago, nikivi said:

~/src/extensions/alfred/alfred-my-mind master*
❯ source .env                           
Print: Entry, ":bundleid", Does Not Exist
Print: Entry, ":version", Does Not Exist
Print: Entry, ":name", Does Not Exist
Print: Entry, ":variables:USER_ID", Does Not Exist

 

Okay, I'm done. Use your own brain, not mine.

Link to post
Just now, deanishe said:

workflow's cache directory

 

Ok I thought so. I'll make some tooling or something to make this process of opening the right thing easier. This whole thing is still unclear to me and you still don't want to share your secrets of developing workflows. You write go code, run `modd` which watches go files and compiles workflow on change. Then you open the debugger in your editor (by going to Finder and opening it from there or you have nicer tooling for it). 

 

1 minute ago, deanishe said:

Okay, I'm done. Use your own brain, not mine

 

Don't be so dismissive. Some people genuinely do ask for help and don't know what's better. I know how to google things and still get stuck.

Link to post

In any way, I did ask earnestly and I think the end result will be best to everyone in Alfred community. All I want is to know how to develop workflows in go as I think it's missing. I want to write that doc but don't know yet how..

Edited by nikivi
Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...