diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 163a6c5..d3dc405 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,9 +4,9 @@ on: workflow_dispatch: push: paths-ignore: - - "README.md" + - 'README.md' tags: - - "v*" + - 'v*' jobs: desktop-build: @@ -18,6 +18,12 @@ jobs: - name: Checkout Repository uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.10' + cache: 'pip' + - name: Install Dependencies run: | pip3 install --upgrade pip setuptools @@ -25,8 +31,7 @@ jobs: pip3 install -r requirements.txt - name: Pyinstaller Build - run: | - pyinstaller main.spec --distpath . + run: pyinstaller build/main.spec --distpath . - name: Upload Artifact uses: actions/upload-artifact@v3 @@ -60,27 +65,35 @@ jobs: - name: Checkout Repository uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.10' + cache: 'pip' + + - name: Install Dependencies + run: | + sudo add-apt-repository universe + sudo apt install libfuse2 + wget -q -O appimage-builder-x86_64.AppImage https://github.com/AppImageCrafters/appimage-builder/releases/download/v1.1.0/appimage-builder-1.1.0-x86_64.AppImage + chmod +x appimage-builder-x86_64.AppImage + pip3 install wheel + - name: Amd64 Build if: ${{ matrix.arch == 'amd64' }} +# uses: AppImageCrafters/build-appimage@master +# with: +# recipe: build/AppImageBuilder_amd64.yml run: | - pip3 install --upgrade pip setuptools - pip3 install pyinstaller staticx - pip3 install -r requirements.txt - pyinstaller main.spec - staticx dist/LiveRecorder LiveRecorder + ./appimage-builder-x86_64.AppImage --recipe build/AppImageBuilder_amd64.yml - name: Arm64 Build if: ${{ matrix.arch == 'arm64' }} - uses: pguyot/arm-runner-action@v2 - with: - base_image: raspios_lite_arm64:latest - copy_artifact_path: LiveRecorder - commands: | - sudo apt install python3-pip -y - pip3 install --upgrade pip setuptools - pip3 install pyinstaller - pip3 install -r requirements.txt - pyinstaller main.spec --distpath . +# uses: AppImageCrafters/build-appimage@master +# with: +# recipe: build/AppImageBuilder_arm64.yml + run: | + ./appimage-builder-x86_64.AppImage --recipe build/AppImageBuilder_arm64.yml - name: Upload Artifact uses: actions/upload-artifact@v3 diff --git a/build/AppImageBuilder_amd64.yml b/build/AppImageBuilder_amd64.yml new file mode 100644 index 0000000..3ed75b9 --- /dev/null +++ b/build/AppImageBuilder_amd64.yml @@ -0,0 +1,36 @@ +version: 1 +script: +# - which mksquashfs || apt install squashfs-tools + - rm -rf AppDir | true + - rm -rf appimage-build | true + - mkdir -p AppDir/usr/src + - cp main.py AppDir/usr/src + - mkdir -p AppDir/usr/share/icons + - cp build/bambino.png AppDir/usr/share/icons + - python3.10 -m pip install --ignore-installed --prefix=/usr --root=AppDir -r requirements.txt + +AppDir: + path: ./AppDir + app_info: + id: LiveRecorder + name: LiveRecorder + icon: bambino + version: Linux + exec: usr/bin/python3.10 + exec_args: '$APPDIR/usr/src/main.py $@' + + apt: + arch: amd64 + sources: + - sourceline: 'deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy main restricted universe multiverse' + key_url: 'http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x871920d1991bc93c' + include: + - python3 + + runtime: + env: + PYTHONHOME: '${APPDIR}/usr' + PYTHONPATH: '${APPDIR}/usr/lib/python3.10/site-packages' + +AppImage: + arch: x86_64 \ No newline at end of file diff --git a/build/AppImageBuilder_arm64.yml b/build/AppImageBuilder_arm64.yml new file mode 100644 index 0000000..bf1be60 --- /dev/null +++ b/build/AppImageBuilder_arm64.yml @@ -0,0 +1,36 @@ +version: 1 +script: +# - which mksquashfs || apt install squashfs-tools + - rm -rf AppDir | true + - rm -rf appimage-build | true + - mkdir -p AppDir/usr/src + - cp main.py AppDir/usr/src + - mkdir -p AppDir/usr/share/icons + - cp build/bambino.png AppDir/usr/share/icons + - python3.10 -m pip install --ignore-installed --prefix=/usr --root=AppDir -r requirements.txt + +AppDir: + path: ./AppDir + app_info: + id: LiveRecorder + name: LiveRecorder + icon: bambino + version: Linux + exec: usr/bin/python3.10 + exec_args: '$APPDIR/usr/src/main.py $@' + + apt: + arch: arm64 + sources: + - sourceline: 'deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports jammy main restricted universe multiverse' + key_url: 'http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x871920d1991bc93c' + include: + - python3 + + runtime: + env: + PYTHONHOME: '${APPDIR}/usr' + PYTHONPATH: '${APPDIR}/usr/lib/python3.10/site-packages' + +AppImage: + arch: aarch64 \ No newline at end of file diff --git a/bambino.ico b/build/bambino.ico similarity index 100% rename from bambino.ico rename to build/bambino.ico diff --git a/build/bambino.png b/build/bambino.png new file mode 100644 index 0000000..91ded6f Binary files /dev/null and b/build/bambino.png differ diff --git a/main.spec b/build/main.spec similarity index 98% rename from main.spec rename to build/main.spec index 9cb149e..1b98dc5 100644 --- a/main.spec +++ b/build/main.spec @@ -6,7 +6,7 @@ block_cipher = None a = Analysis( - ['main.py'], + ['../main.py'], pathex=[], binaries=[], datas=collect_data_files('streamlink.plugins', include_py_files=True),