Cat-Printer icon indicating copy to clipboard operation
Cat-Printer copied to clipboard

Automatic creation of the bare bundle

Open frankenstein91 opened this issue 2 years ago • 8 comments

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.

  • [x] Tested with act on my system
  • [x] Tested with a tag on my fork

frankenstein91 avatar Apr 17 '22 23:04 frankenstein91

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?

NaitLee avatar Apr 18 '22 09:04 NaitLee

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.

frankenstein91 avatar Apr 18 '22 09:04 frankenstein91

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)

NaitLee avatar Apr 18 '22 10:04 NaitLee

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'

frankenstein91 avatar Apr 18 '22 13:04 frankenstein91

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

NaitLee avatar Apr 18 '22 13:04 NaitLee

Also remove __pycache__:

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

frankenstein91 avatar Apr 18 '22 13:04 frankenstein91

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 avatar Apr 18 '22 13:04 frankenstein91

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

frankenstein91 avatar Apr 18 '22 13:04 frankenstein91