From 33cc32438155401a2d4901190738e363de92327e Mon Sep 17 00:00:00 2001 From: Alex Xu Date: Wed, 31 Jan 2024 11:49:27 -0800 Subject: [PATCH] prepare m1 build pipeline (#669) --- .github/workflows/package-macos.yml | 9 ++++++--- .github/workflows/package-windows-with-docker.yml | 6 +++--- README.md | 5 +++-- setup.py | 3 ++- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/.github/workflows/package-macos.yml b/.github/workflows/package-macos.yml index 663b9d11..f493c79a 100644 --- a/.github/workflows/package-macos.yml +++ b/.github/workflows/package-macos.yml @@ -23,7 +23,10 @@ on: jobs: build: - runs-on: macos-latest + strategy: + matrix: + os: [ macos-latest, macos-14 ] + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - name: Set up Python @@ -77,7 +80,7 @@ jobs: - name: upload build uses: actions/upload-artifact@v4 with: - name: mac-os-build + name: mac-os-build-${{ runner.arch }} path: dist/*.dmg - name: Release uses: softprops/action-gh-release@v1 @@ -95,4 +98,4 @@ jobs: # if: ${{ always() }} run: | security delete-keychain $RUNNER_TEMP/app-signing.keychain-db - rm ~/Library/MobileDevice/Provisioning\ Profiles/build_pp.mobileprovision \ No newline at end of file + rm ~/Library/MobileDevice/Provisioning\ Profiles/build_pp.mobileprovision diff --git a/.github/workflows/package-windows-with-docker.yml b/.github/workflows/package-windows-with-docker.yml index e18bb670..6212a9ec 100644 --- a/.github/workflows/package-windows-with-docker.yml +++ b/.github/workflows/package-windows-with-docker.yml @@ -43,9 +43,9 @@ jobs: - name: rename binaries run: | version_built=$(cat kindlecomicconverter/__init__.py | grep version | awk '{print $3}' | sed "s/[^.0-9b]//g") - mv dist/windows/kcc.exe dist/windows/kcc_${version_built}.exe - mv dist/windows/kcc-c2e.exe dist/windows/kcc_c2e_${version_built}.exe - mv dist/windows/kcc-c2p.exe dist/windows/kcc_c2p_${version_built}.exe + mv dist/windows/kcc.exe dist/windows/KCC_${version_built}.exe + mv dist/windows/kcc-c2e.exe dist/windows/KCC_c2e_${version_built}.exe + mv dist/windows/kcc-c2p.exe dist/windows/KCC_c2p_${version_built}.exe - name: upload build uses: actions/upload-artifact@v4 with: diff --git a/README.md b/README.md index 0e08d4bf..211cb242 100644 --- a/README.md +++ b/README.md @@ -39,8 +39,9 @@ If you find **KCC** valuable you can consider donating to the authors: Click on **Assets** of the latest release. You probably want either -- `kcc_*.*.*.exe` (Windows) -- `KindleComicConverter_osx_*.*.*.dmg` (Mac) +- `KCC_*.*.*.exe` (Windows) +- `kcc_macos_arm_*.*.*.dmg` (recent Mac with Apple Silicon M1 chip or later) +- `kcc_macos_i386_*.*.*.dmg` (older Mac with Intel chip) The `c2e` and `c2p` versions are command line tools for power users. diff --git a/setup.py b/setup.py index 3dc5a694..1815f2e9 100644 --- a/setup.py +++ b/setup.py @@ -11,6 +11,7 @@ """ import os +import platform import sys import setuptools import distutils.cmd @@ -38,7 +39,7 @@ def run(self): if sys.platform == 'darwin': os.system('pyinstaller -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('appdmg kcc.json dist/KindleComicConverter_osx_' + VERSION + '.dmg') + os.system(f'appdmg kcc.json dist/kcc_macos_{platform.processor()}_{VERSION}.dmg') sys.exit(0) elif sys.platform == 'win32': os.system('pyinstaller -y -F -i icons\\comic2ebook.ico -n KCC_' + VERSION + ' -w --noupx kcc.py')