RangerMauve / hyper-sdk

Make your own hyper apps!
https://www.youtube.com/watch?v=HyHk4aImd_I&list=PL7sG5SCUNyeYx8wnfMOUpsh7rM_g0w_cu&index=20
MIT License
292 stars 45 forks source link

GitHub Actions #85

Closed JamesTheAwesomeDude closed 3 years ago

JamesTheAwesomeDude commented 3 years ago

This PR calls GitHub's free CI service whenever a push or a pull request is made. It additionally makes build artifacts available to download and take for a spin without ever having to set up a development environment on one's local machine.

Does it look appropriate?

RangerMauve commented 3 years ago

Actually, is it possible to run this on tags and to upload the bundle to the release artifacts?

I've only ever used that functionality with electron-builder so I'm not sure how it works for regular node modules. 😅

JamesTheAwesomeDude commented 3 years ago

is it possible to run this on tags and to upload the bundle to the release artifacts

Preliminarily, it looks like that's not as trivial as one would like it to be: there are some 3rd-party scripts to do so, but it's not well-integrated…

Aha, I seem to have found this: https://github.com/softprops/action-gh-release

A common case for GitHub releases is to upload your binary after its been validated and packaged. Use the with.files input to declare a newline-delimited list of glob expressions matching the files you wish to upload to GitHub releases. If you'd like you can just list the files by name directly.

I haven't committed support for it just yet, but it looks like it'd be as simple as on: release

So, in any case, it should only formally attach artifacts to Release-tagged commits; but do you want me to have it build stuff for pushes and PRs anyway, for general CI purposes?


It looks like it will require some sort of token, once accepted:

The following are required as step.env keys:

GITHUB_TOKEN

JamesTheAwesomeDude commented 3 years ago

Hmm, actually, upon further inspection:

It looks like, to leverage that Action to attach files to Releases automatically, you would also have to entrust it with the creation of Releases, which would probably entail having a separate release branch that you push to (which may be a nontrivial change to your workflow.)

I will have to do a bit more research into the options for automatically attaching build artifacts to Releases. (Though, as currently drafted, this PR would enable "simply" downloading the Artifact associated with a commit and attaching it to its associated Release manually.)

RangerMauve commented 3 years ago

@JamesTheAwesomeDude I can supply the GH token for this, sure.

but do you want me to have it build stuff for pushes and PRs anyway, for general CI purposes?

Your call on what you think would be useful for folks. 😁

It looks like, to leverage that Action to attach files to Releases automatically, you would also have to entrust it with the creation of Releases,

Can it detect new tags to create releases? That's what electron-builder does in Agregore

Also, if you're not interested in messing around with the release stuff I'm okay with leaving it as a TODO and doing the PR based build artifact thing in the meantime. There's no pressure either way of course. 😁