IzaKastra / wsdist

Python3-based damage simulator for Final Fantasy XI
12 stars 4 forks source link

Added GitHub Action to build & upload executable #12

Closed ZubisFFXI closed 1 year ago

ZubisFFXI commented 1 year ago

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:

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 commented 1 year ago

You can see this on my fork at

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

IzaKastra commented 1 year ago

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 commented 1 year ago

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.

ZubisFFXI commented 1 year ago

Thank you 👍