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

Added GitHub Action to build & upload executable #12

Merged
merged 4 commits into from Apr 1, 2023

Conversation

ZubisFFXI
Copy link
Contributor

@ZubisFFXI ZubisFFXI commented Mar 20, 2023

Description

Currently the release artifact .exe is built by the developer and checked into the code as part of a standard commit.
This is not recommended best practice on GitHub for several reasons:

  • Adding binary objects bloats the size of the repo.
  • It goes out of date quickly.
  • It brings up security issues in that we have to trust the developer didn't put anything malicious into the executable.
  • A release pipeline tool already exists on GitHub and was really easy to get up and running.

Change

A GitHub Action file has been added to the repo. This will build and output the exe for download on the creation of a Pull Request, or merge of code to the main branch.

You can review the builds under Actions.
image

image

  1. Build is where the exe is built using the python cli commands.
  2. Publish Artifacts is where the icons and exe is merged after the Build.
  3. wsdist-executable-only is a zip file of the exe only, in case you want to refresh your local copy.
  4. wsdist-full is a zip file of the required files (exe, txt, & 2 icon folders) that are required to run the exe.

image

Future Work/Recommendations

I would advise you to delete the exe from the source code and use the GitHub Action going forward to generate the release.
You can also create releases on GitHub (ie v1.0.0) and the artifact should upload into it.

@ZubisFFXI
Copy link
Contributor Author

You can see this on my fork at

https://github.com/ZubisFFXI/wsdist/actions

@IzaKastra
Copy link
Owner

IzaKastra commented Mar 21, 2023

Thanks. I've spent the last hour or so reading about workflows and releases since these are both new to me.

For the most part, your workflow file is simple and easy to follow. However, I don't understand why it needs to trigger on "pull_request" or "release." Isn't triggering on a push to "main" enough? I'd prefer it to only run the workflow when I update the code in the repository. I guess this would mean also updating the concurrency group to just ${{ github.ref }}?

I still need to finish reviewing GitHub Releases, but it seems like the last bit of your workflow will automatically create a new release version of the GitHub repository and include the wsdist.zip packaged executable and necessary files/directories. Do I need to first create a v1.0.0 for the workflow to recognize it? Does it automatically iterate version number? I also see this is possible with https://github.com/rymndhng/release-on-push-action, but it seems that the env GITHUB_TOKEN was listed as deprecated in the version of action-gh-release that you have in your workflow.

I'll keep looking into this later before I merge anything.

@ZubisFFXI
Copy link
Contributor Author

Re: pull_request:

It's a best practice concept called https://en.wikipedia.org/wiki/CI/CD

In short, you want the build to happen before the code is merged not after - on the creation of a pull request. That way you can be sure no-one's broken anything.

Because you're new to GitHub Actions, I've removed the release stuff from the code. You can always come back to it later.
For now it just builds the artifacts.

@IzaKastra IzaKastra merged commit d59d288 into IzaKastra:main Apr 1, 2023
@ZubisFFXI ZubisFFXI deleted the add_github_action_build branch April 1, 2023 21:29
@ZubisFFXI
Copy link
Contributor Author

Thank you 👍

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.

None yet

2 participants