From 48d1e7ffadb79f706132f143f525e6187ee139ab Mon Sep 17 00:00:00 2001 From: Orinks Date: Wed, 27 May 2026 22:08:54 -0400 Subject: [PATCH] fix(build): sync scheduled nightly workflow --- .github/workflows/build.yml | 77 ++++++++++++++++++++++--------------- 1 file changed, 45 insertions(+), 32 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 630b8a1..47458ad 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,6 +24,7 @@ concurrency: env: PYTHON_VERSION: "3.11" + NUITKA_CACHE_DIR: ${{ github.workspace }}/.nuitka-cache jobs: prepare: @@ -98,47 +99,42 @@ jobs: python-version: ${{ env.PYTHON_VERSION }} cache: pip + - name: Restore Nuitka cache + uses: actions/cache/restore@v5 + with: + path: .nuitka-cache + key: nuitka-${{ runner.os }}-py${{ env.PYTHON_VERSION }}-${{ hashFiles('pyproject.toml', 'installer/build_nuitka.py') }}-${{ github.run_id }} + restore-keys: | + nuitka-${{ runner.os }}-py${{ env.PYTHON_VERSION }}-${{ hashFiles('pyproject.toml', 'installer/build_nuitka.py') }}- + nuitka-${{ runner.os }}-py${{ env.PYTHON_VERSION }}- + - name: Install dependencies - run: pip install -e .[dev] pyinstaller pillow + run: pip install -e .[dev,build] + + - name: Install Inno Setup + run: choco install innosetup -y --no-progress - name: Build run: | python scripts/generate_build_meta.py ${{ needs.prepare.outputs.is_nightly == 'true' && needs.prepare.outputs.tag || '' }} - python -m PyInstaller --clean --noconfirm installer/portkeydrop.spec + python installer/build_nuitka.py --tag "${{ needs.prepare.outputs.is_nightly == 'true' && needs.prepare.outputs.tag || '' }}" - name: Validate runtime deps for installer/portable run: | - python scripts/verify_portable_zip.py --runtime-dir dist/PortkeyDrop_dir --pyz-path build/portkeydrop/PYZ-00.pyz --require-runtime-no-data - - - name: Create installer - shell: cmd - run: | - echo [version]> dist\version.txt - echo value=${{ needs.prepare.outputs.version }}>> dist\version.txt - choco install innosetup -y --no-progress - "%ProgramFiles(x86)%\Inno Setup 6\ISCC.exe" installer\portkeydrop.iss - - - name: Create portable ZIP - shell: cmd - run: | - cd dist - if exist "PortkeyDrop_dir" ( - if exist "PortkeyDrop_portable" rmdir /s /q "PortkeyDrop_portable" - xcopy "PortkeyDrop_dir" "PortkeyDrop_portable\" /E /I /Y >nul - if not exist "PortkeyDrop_portable\\data" mkdir "PortkeyDrop_portable\\data" - cd PortkeyDrop_portable - 7z a -tzip "..\PortkeyDrop_Portable_v${{ needs.prepare.outputs.version }}.zip" * - cd .. - rmdir /s /q "PortkeyDrop_portable" - ) else ( - 7z a -tzip "PortkeyDrop_Portable_v${{ needs.prepare.outputs.version }}.zip" "PortkeyDrop.exe" - ) + python scripts/verify_portable_zip.py --runtime-dir dist/PortkeyDrop_dir --require-runtime-no-data - name: Validate portable ZIP contents run: | - python scripts/verify_portable_zip.py --runtime-dir dist/PortkeyDrop_dir --pyz-path build/portkeydrop/PYZ-00.pyz --require-runtime-no-data --portable-zip dist/PortkeyDrop_Portable_v${{ needs.prepare.outputs.version }}.zip + python scripts/verify_portable_zip.py --runtime-dir dist/PortkeyDrop_dir --require-runtime-no-data --portable-zip dist/PortkeyDrop_Portable_v${{ needs.prepare.outputs.version }}.zip - - uses: actions/upload-artifact@v6 + - name: Save Nuitka cache + if: always() + uses: actions/cache/save@v5 + with: + path: .nuitka-cache + key: nuitka-${{ runner.os }}-py${{ env.PYTHON_VERSION }}-${{ hashFiles('pyproject.toml', 'installer/build_nuitka.py') }}-${{ github.run_id }} + + - uses: actions/upload-artifact@v7 with: name: windows path: | @@ -162,17 +158,34 @@ jobs: python-version: ${{ env.PYTHON_VERSION }} cache: pip + - name: Restore Nuitka cache + uses: actions/cache/restore@v5 + with: + path: .nuitka-cache + key: nuitka-${{ runner.os }}-py${{ env.PYTHON_VERSION }}-${{ hashFiles('pyproject.toml', 'installer/build_nuitka.py') }}-${{ github.run_id }} + restore-keys: | + nuitka-${{ runner.os }}-py${{ env.PYTHON_VERSION }}-${{ hashFiles('pyproject.toml', 'installer/build_nuitka.py') }}- + nuitka-${{ runner.os }}-py${{ env.PYTHON_VERSION }}- + - name: Install dependencies run: | pip install --only-binary wxPython wxPython - pip install -e .[dev] pyinstaller pillow + pip install -e .[dev,build] - name: Build timeout-minutes: 30 run: | - python installer/build.py --skip-installer --tag "${{ needs.prepare.outputs.is_nightly == 'true' && needs.prepare.outputs.tag || '' }}" + python scripts/generate_build_meta.py ${{ needs.prepare.outputs.is_nightly == 'true' && needs.prepare.outputs.tag || '' }} + python installer/build_nuitka.py --skip-installer --tag "${{ needs.prepare.outputs.is_nightly == 'true' && needs.prepare.outputs.tag || '' }}" + + - name: Save Nuitka cache + if: always() + uses: actions/cache/save@v5 + with: + path: .nuitka-cache + key: nuitka-${{ runner.os }}-py${{ env.PYTHON_VERSION }}-${{ hashFiles('pyproject.toml', 'installer/build_nuitka.py') }}-${{ github.run_id }} - - uses: actions/upload-artifact@v6 + - uses: actions/upload-artifact@v7 with: name: macos path: |