SpykerNZ / one-pace-for-plex

This project helps adapt One Pace to a format plex can read.
79 stars 9 forks source link

CI: Automate pyinstaller builds for Windows #26

Closed cawnj closed 8 months ago

cawnj commented 8 months ago

Describe your changes

Sets up a GitHub actions workflow to automatically build rename.exe whenever rename.py changes.
This test branch shows it working - https://github.com/cawnj/one-pace-for-plex/tree/pyinstaller-gh-actions-test

Using the command pyinstaller --onefile dist/rename.py, not sure if there's any other options you use @SpykerNZ but it seems to output a working exe at least.

Lots of small commits here so if it's good to go (and something we actually want integrated in the first place!), a squash and merge is best 🙏

SpykerNZ commented 8 months ago

Love this! Great work.

The command you mentioned is what I use to build the installer manually, so a good start.

Windows Virus Issue I downloaded rename.exe from your test branch, and windows seems to think it is a virus. 🦠 Not sure if there is a way around this? Compiling it manually never seemed to have this issue - I presume something to do with building in the cloud. I recall you are on a Linux machine so can't test this? I may be able to find some time to take a look later in the week.

image

EDIT: A quick google indicates this might be an issue we cannot get around. If we went this path we may have to highlight to users that you have to ignore virus protection which isn't ideal. To be investigated further, I've only spent like 10 minutes looking into this so far.

Possible Future Work I used to have the json files bundled in with the python script. I unbundled them as I didn't want to re-build the .exe whenever changes were made to these (plus allows users to make small changes easier). Could consider re-bundling them again for ease of use. I think merging this PR in the first instance makes sense - can look at further changes after.

cawnj commented 8 months ago

Ah damn, I wonder what the difference is between the binary compiled in CI vs the one you've done manually that it's being false flagged by Windows Defender. Will do some more research when I get the time, but for now I'll close the PR - and hopefully re-open sometime when I have a better idea of a solution here.

SpykerNZ commented 8 months ago

yea not sure exactly! looks to be a common problem, can see some related issues here: github.com/pyinstaller/pyinstaller/issues?q=label%3Aantivirus-false-positives

An older version of pyinstaller may work.