devOpifex / cranlogs

Cranlogs
MIT License
7 stars 2 forks source link

ci: add test + release infra #5

Closed dpastoor closed 2 years ago

dpastoor commented 2 years ago

alrighty, so lets break this down.

There are two things being added here:

1) a .Taskfile.yml - which is https://github.com/go-task/task a nice crossplatform alternative to make. This is where most of the plumbing lives and can be run outside of the CI system.

2)The github actions build

All the CI stuff is heavily focused on running on main or in a tag as it currently exists. I will comment on pieces inline to describe in more detail.

In order to get this to work fully, you'll need to add two secrets for your actions:

image

for the github token it should be a PAT with repo scopes:

Screen Shot 2022-02-02 at 1 35 48 PM

The reason its not named GITHUBTOKEN (even though thats what goreleaser wants) is GITHUB* is actually a reserved phrase for github actions.

The FURY_TOKEN will be a new PUSH token that looks like:

Screen Shot 2022-01-29 at 4 42 21 PM

Finally, to use you'll want to make the packaging on fury public:

Screen Shot 2022-01-29 at 4 52 42 PM
dpastoor commented 2 years ago

after this gets wired up etc, after tagging/pushing the tag, it should autobuild then you'll get a release with like:

image

JohnCoene commented 2 years ago

Thank you so much for all of this Devin!

I apologise in advance but I'm rather busy with work and thus won't be able to look into this until early next week.

It certainly looks amayzing!

dpastoor commented 2 years ago

no worries! when you're able to cycle back dig through it with any questions and we'll finish getting it set up!

JohnCoene commented 2 years ago

Thanks for this Devin!

I got some this working though I struggled a bit here an there as you can tell by the commits. I cannot figure why the tests fail though. The only thing I see is that I do not have tests though go test does not error and, having cloned your fab repo I see you do not have tests either, but your workflow seems to work just fine.

I'm definitely missing something here

dpastoor commented 2 years ago

ah! i think i see in the build failures (missing version flag setup as well) - let me pull things locally and see if I can replicate/find more failures. Looks like you already got to a couple other pieces like the man command.

JohnCoene commented 2 years ago

Ah thanks, I'll add that and try again

dpastoor commented 2 years ago

kk https://github.com/devOpifex/cranlogs/pull/6 🤞

JohnCoene commented 2 years ago

Ok, we're good, I can see deb and rpm on fury, it's public.

This is so cool!