Skip to content
This repository has been archived by the owner on Oct 13, 2024. It is now read-only.

Option to configure build script name #12

Closed
leclercb opened this issue Jan 26, 2020 · 6 comments
Closed

Option to configure build script name #12

leclercb opened this issue Jan 26, 2020 · 6 comments
Labels
enhancement New feature or request

Comments

@leclercb
Copy link
Contributor

leclercb commented Jan 26, 2020

Thanks for the action script !
It would be nice to be able to configure the build script name.

For the moment, this is how my scripts are looking, it's pretty hard to get the git hash via a command that works on every system. So I created two build scripts:

"build": "REACT_APP_GIT_COMMIT_HASH=$(git rev-parse --short HEAD) craco build", "build:github": "craco build",

And in the build and release steps of my workflow I added:

env: REACT_APP_GIT_COMMIT_HASH: "${{ github.sha }}"

PS: The script is working fine, but no artifact is generated once the build is complete, is it normal ?

Thanks

@samuelmeuli
Copy link
Owner

Yes, let's introduce an option for this (maybe called build_script or build_script_name). @leclercb Would you be interested in opening a PR?

Regarding the missing artifacts, have you set the release option? By default, no release is created.

@samuelmeuli samuelmeuli added the enhancement New feature or request label Jan 28, 2020
@leclercb
Copy link
Contributor Author

leclercb commented Jan 28, 2020

PR created.

To be honest, I didn't try the release yet as I still need to test the certificates option.
What I mean, is that GitHub Actions is able to produce artifacts, that you can download when looking at the process.
Adding an extra step in my yaml workflow to publish the artifact could do the trick.
I don't know if it's feasible, but if this could be automatically called by the "action-electron-builder" it would be even better.

Because for the moment, if you don't release, you can see that the build was successful, but there is no way to download the generated binaries.

I hope it was clearer.

@samuelmeuli
Copy link
Owner

Now I understand. You're right, this isn't currently implemented. Could adding a https://github.com/actions/upload-artifact step after the Electron Builder Action work? If it's really that simple, I don't think this should be included in the action, but added to the README or a docs page.

@leclercb
Copy link
Contributor Author

leclercb commented Jan 28, 2020

Actually, it's not that simple, because you need to know the name of the files generated, depending on the OS, multiple artifacts can be built and currently the upload-artifact action doesn't allow regex or patterns for multiple files.
That's why, if "action-electron-builder" could call them, knowing the right name of every file created and then upload them, it would be much easier.

And btw, I think almost everybody would want to be able to download the generated binaries using this action instead of only knowing if it's successful or not.

@samuelmeuli
Copy link
Owner

I agree on the file renaming. But I don't know if uploading artifacts from within an action is already possible; I'm not sure if the API is already publicly available (see actions/upload-artifact#7 (comment) and https://developer.github.com/v3/actions/artifacts).

@samuelmeuli
Copy link
Owner

This is tracked by #14

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants