From 03e0118fb7b3817477b5d6a0fbed9097b3c2500a Mon Sep 17 00:00:00 2001 From: jxxghp Date: Fri, 17 Nov 2023 11:39:03 +0800 Subject: [PATCH] add linux frozen build --- .github/workflows/build.yml | 66 +++++++++++++++++++++++++++++++++++-- windows.spec => frozen.spec | 0 2 files changed, 64 insertions(+), 2 deletions(-) rename windows.spec => frozen.spec (100%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9502af29a..c16b9d0da 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -110,7 +110,7 @@ jobs: - name: Pyinstaller run: | - pyinstaller windows.spec + pyinstaller frozen.spec shell: pwsh - name: Upload Windows File @@ -119,10 +119,71 @@ jobs: name: windows path: dist/MoviePilot.exe + Linux-build: + runs-on: ubuntu-latest + name: Build Linux Binary + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Init Python 3.11.4 + uses: actions/setup-python@v4 + with: + python-version: '3.11.4' + cache: 'pip' + + - name: Install Dependent Packages + run: | + python -m pip install --upgrade pip + pip install wheel pyinstaller + pip install -r requirements.txt + + - name: Prepare Frontend + run: | + wget http://nginx.org/download/nginx-1.25.2.zip + unzip nginx-1.25.2.zip + mv nginx-1.25.2/nginx-1.25.2 nginx + rm nginx-1.25.2.zip + rm -rf nginx-1.25.2 + + FRONTEND_VERSION=$(curl -s "https://api.github.com/repos/jxxghp/MoviePilot-Frontend/releases/latest" | jq -r .tag_name) + wget "https://github.com/jxxghp/MoviePilot-Frontend/releases/download/$FRONTEND_VERSION/dist.zip" + unzip dist.zip + mv dist/dist/* nginx/html + rm dist.zip + rm -rf dist + mv nginx/html/nginx.conf nginx/conf/nginx.conf + mkdir -p nginx/temp + touch nginx/temp/__keep__.txt + mkdir -p nginx/logs + touch nginx/logs/__keep__.txt + + wget https://github.com/jxxghp/MoviePilot-Plugins/archive/refs/heads/main.zip + unzip MoviePilot-Plugins-main.zip + mv MoviePilot-Plugins-main/MoviePilot-Plugins-main/plugins/* app/plugins/ + rm MoviePilot-Plugins-main.zip + rm -rf MoviePilot-Plugins-main + + wget https://github.com/jxxghp/MoviePilot-Resources/archive/refs/heads/main.zip + unzip MoviePilot-Resources-main.zip + mv MoviePilot-Resources-main/MoviePilot-Resources-main/resources/* app/helper/ + rm MoviePilot-Resources-main.zip + rm -rf MoviePilot-Resources-main + + - name: Pyinstaller + run: | + pyinstaller frozen.spec + + - name: Upload Ubuntu File + uses: actions/upload-artifact@v3 + with: + name: ubuntu + path: dist/MoviePilot + Create-release: permissions: write-all runs-on: ubuntu-latest - needs: [ Windows-build, Docker-build ] + needs: [ Windows-build, Docker-build, Linux-build ] steps: - uses: actions/checkout@v2 @@ -140,6 +201,7 @@ jobs: run: | mkdir releases mv ./windows/MoviePilot.exe ./releases/MoviePilot_v${{ env.app_version }}.exe + mv ./ubuntu/dist/MoviePilot ./releases/MoviePilot_amd64_v${{ env.app_version }} - name: Create Release id: create_release diff --git a/windows.spec b/frozen.spec similarity index 100% rename from windows.spec rename to frozen.spec