diff --git a/.github/workflows/package-osx-legacy.yml b/.github/workflows/package-osx-legacy.yml new file mode 100644 index 0000000..304f404 --- /dev/null +++ b/.github/workflows/package-osx-legacy.yml @@ -0,0 +1,66 @@ +name: build KCC for osx legacy + +on: + workflow_dispatch: + push: + tags: + - "v*.*.*" + + # Don't trigger if it's just a documentation update + paths-ignore: + - '**.md' + - '**.MD' + - '**.yml' + - '**.sh' + - 'docs/**' + - 'Dockerfile' + - 'LICENSE' + - '.gitattributes' + - '.gitignore' + - '.dockerignore' + +jobs: + build: + strategy: + matrix: + os: [ macos-13 ] + runs-on: ${{ matrix.os }} + env: + # We need the official Python, because the GA ones only support newer macOS versions + # The deployment target is picked up by the Python build tools automatically + PYTHON_VERSION: 3.11.9 + MACOSX_DEPLOYMENT_TARGET: '10.13' + steps: + - uses: actions/checkout@v4 + - name: Get Python + run: curl https://www.python.org/ftp/python/3.11.9/python-3.11.9-macos11.pkg -o "python.pkg" + - name: Install Python + run: | + sudo installer -pkg python.pkg -target / + - name: Install Python dependencies + run: | + python3 --version + pip3 install --upgrade pip setuptools wheel pyinstaller certifi + pip3 install --upgrade -r requirements-osx-legacy.txt + ./gen_ui_files.sh + - uses: actions/setup-node@v4 + with: + node-version: 16 + - run: npm install -g appdmg + - name: build binary + run: | + python3 setup.py build_binary + - name: upload build + uses: actions/upload-artifact@v4 + with: + name: osx-build-${{ runner.arch }} + path: dist/*.dmg + - name: Release + uses: softprops/action-gh-release@v2 + if: startsWith(github.ref, 'refs/tags/') + with: + prerelease: true + generate_release_notes: true + files: | + LICENSE.txt + dist/*.dmg diff --git a/requirements-osx-legacy.txt b/requirements-osx-legacy.txt new file mode 100644 index 0000000..018a600 --- /dev/null +++ b/requirements-osx-legacy.txt @@ -0,0 +1,12 @@ +PySide6==6.5.2 +Pillow>=11.3.0 +psutil>=5.9.5 +requests>=2.31.0 +python-slugify>=1.2.1 +raven>=6.0.0 +packaging>=23.2 +mozjpeg-lossless-optimization>=1.2.0 +natsort>=8.4.0 +distro>=1.8.0 +numpy<2 +PyMuPDF>=1.26.1 diff --git a/setup.py b/setup.py index 34f5652..0b14e7e 100644 --- a/setup.py +++ b/setup.py @@ -38,7 +38,10 @@ class BuildBinaryCommand(setuptools.Command): if sys.platform == 'darwin': os.system('pyinstaller --hidden-import=_cffi_backend -y -D -i icons/comic2ebook.icns -n "Kindle Comic Converter" -w -s kcc.py') # TODO /usr/bin/codesign --force -s "$MACOS_CERTIFICATE_NAME" --options runtime dist/Applications/Kindle\ Comic\ Converter.app -v - os.system(f'appdmg kcc.json dist/kcc_macos_{platform.processor()}_{VERSION}.dmg') + if os.getenv('MACOSX_DEPLOYMENT_TARGET') == '10.13': + os.system(f'appdmg kcc.json dist/kcc_osx_10_13_legacy_{VERSION}.dmg') + else: + os.system(f'appdmg kcc.json dist/kcc_macos_{platform.processor()}_{VERSION}.dmg') sys.exit(0) elif sys.platform == 'win32': os.system('pyinstaller --hidden-import=_cffi_backend -y -F -i icons\\comic2ebook.ico -n KCC_' + VERSION + ' -w --noupx kcc.py')