Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 45 additions & 32 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ concurrency:

env:
PYTHON_VERSION: "3.11"
NUITKA_CACHE_DIR: ${{ github.workspace }}/.nuitka-cache

jobs:
prepare:
Expand Down Expand Up @@ -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: |
Expand All @@ -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: |
Expand Down
Loading