NaitLee / Cat-Printer

Application supporting Bluetooth thermal “Cat Printers”, for everyone!
GNU General Public License v3.0
334 stars 33 forks source link

Automatic creation of the bare bundle #16

Open frankenstein91 opened 2 years ago

frankenstein91 commented 2 years ago

I had an idea how to automatically start the build process when creating a tag. The zip created is hosted with a checksum right on Github on the tag.

I hope it helps you.

NaitLee commented 2 years ago

GitHub workflow is interesting. In our case bundling "bare" edition is even very easy to do manually. It may work best to (also) make "pure" and "windows" edition all together, while these only requires some additional files (bleak, bleak-winrt lib and "stripped" embedded windows python runtime). ... is it possible?

frankenstein91 commented 2 years ago

I think it should be possible. I have tried to use the build all script but got an error. It looks like I can only build the windows bundle in Windows. But that's possible to an free for public repository. I think I'm able to also build the android version in that way. But I would put every bundle in it's own workflow. That's better for doing it in parallel... I think.

NaitLee commented 2 years ago

Oh, right... This lets me think to modify the bundling script, as it's somewhat confusing... Actually, "pure" is "bare" plus bleak, and "windows" is just "pure" plus bleak-winrt and py runtime. These could be done at once in a chain. Also it should remind the developer if something is missing, and tell him/her what to do -- or automatically do it (needs internet connection).

btw actually no need windows... the windows-must is pip install bleak-winrt, but you can get the binary from an already-published release here.

As you can see in docs I said I would write a guide to do android later. But in fact we can really do automation -- after the hacks. Android needs several hundreds MiBs of SDK, all the hacks, and finally a release apk should be signed (I have cert, needs to manually enter password)

frankenstein91 commented 2 years ago

the pure bundle is working...

Windows makes problems with

Traceback (most recent call last):
  File "D:\a\Cat-Printer\Cat-Printer\build-common\bundle.py", line 106, in <module>
    os.chdir('python-win32-amd64-embed')
FileNotFoundError: [WinError 2] The system cannot find the file specified: 'python-win32-amd64-embed'
NaitLee commented 2 years ago

I see you're working on 🙃 To avoid further confusion, I put all the things needed to build below, extract to build-common, and be sure there are bleak and python-win32-amd64-embed folder there (not in some subdir).

build-common.zip (don't push these to this repo!)

No need to change the system. Bundling takes nothing from it. You can always see what's up by seeing the code. It's just around 120 lines in bundle.py

Also remove __pycache__:

for i in $(find | grep -E '.*\.pyc'); do rm $i; done
for i in $(find | grep -E '__pycache__'); do rm -d $i; done
frankenstein91 commented 2 years ago

Also remove __pycache__:

I think it is not needed as every build is a fresh OS and a fresh copy of this repo

frankenstein91 commented 2 years ago

To avoid further confusion, I put all the things needed to build below, extract to build-common, and be sure there are bleak and python-win32-amd64-embed folder there (not in some subdir).

build-common.zip (don't push these to this repo!)

somehow we have to get it inside of the docker cointainer

frankenstein91 commented 2 years ago

@NaitLee you can ping me via matrix chat @bollerwagenpicard:tchncs.de