From cee18ea914c93d3ef8cdaf4dfd97a893706c4125 Mon Sep 17 00:00:00 2001 From: tonquer Date: Wed, 6 Nov 2024 20:55:02 +0800 Subject: [PATCH] update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新增macos universal2版本 --- .github/workflows/CI.yml | 74 +++++++++++++++++++++++++++---- .github/workflows/release.yml | 79 ++++++++++++++++++++++++++++++---- src/requirements_macos.txt | 5 +-- src/requirements_macos_arm.txt | 12 ------ 4 files changed, 137 insertions(+), 33 deletions(-) delete mode 100644 src/requirements_macos_arm.txt diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 0eaf467..681440b 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -12,28 +12,29 @@ on: jobs: macos: - runs-on: macos-12 + runs-on: macos-latest env: - PACKAGENAME: bika_py37_macos + PACKAGENAME: bika_macos_universal2 steps: - uses: actions/checkout@v4 - - name: Set up Python 3.9 + - name: Set up Python 3.10 uses: actions/setup-python@v5 with: - python-version: 3.9 + python-version: 3.10 - name: Install dependencies run: | python -m pip install --upgrade pip - pip install pyinstaller==4.6 - pip install https://github.com/tonquer/waifu2x-vulkan/releases/download/v1.1.6/sr_ncnn_vulkan-1.2.0-cp39-cp39-macosx_10_9_universal2.whl + pip install pyinstaller + pip install https://github.com/tonquer/waifu2x-vulkan/releases/download/v1.1.6/sr_ncnn_vulkan-1.2.0-cp36.cp37.cp38.cp39.cp310.cp311.cp312.cp313-none-macosx_10_9_universal2.whl + pip install https://github.com/tonquer/waifu2x-vulkan/releases/download/v1.1.6/Pillow-9.1.1-cp310-cp310-macosx_10_10_universal2.whl pip install -r src/requirements_macos.txt brew install create-dmg - name: Build run: | cd src cp ../res/icon/Icon.icns ./ - pyinstaller --clean --onedir --name PicACG \ - --hidden-import waifu2x_vulkan --hidden-import PySide6 --hidden-import requests \ + pyinstaller --target-architecture=universal2 --clean --onedir --name PicACG \ + --hidden-import sr_ncnn_vulkan --hidden-import PySide6 --hidden-import requests \ --hidden-import urllib3 --hidden-import websocket-client --hidden-import pillow \ --hidden-import config \ --hidden-import component \ @@ -65,7 +66,62 @@ jobs: name: ${{ env.PACKAGENAME }} path: bika.zip retention-days: 7 - + + macos-nosr: + runs-on: macos-latest + env: + PACKAGENAME: bika_nosr_macos_universal2 + steps: + - uses: actions/checkout@v4 + - name: Set up Python 3.10 + uses: actions/setup-python@v5 + with: + python-version: 3.10 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install pyinstaller + pip install https://github.com/tonquer/waifu2x-vulkan/releases/download/v1.1.6/Pillow-9.1.1-cp310-cp310-macosx_10_10_universal2.whl + pip install -r src/requirements_macos.txt + brew install create-dmg + - name: Build + run: | + cd src + cp ../res/icon/Icon.icns ./ + pyinstaller --target-architecture=universal2 --clean --onedir --name PicACG \ + --hidden-import sr_ncnn_vulkan --hidden-import PySide6 --hidden-import requests \ + --hidden-import urllib3 --hidden-import websocket-client --hidden-import pillow \ + --hidden-import config \ + --hidden-import component \ + --hidden-import server \ + --hidden-import task \ + --hidden-import tools \ + --hidden-import view \ + --strip --windowed -i Icon.icns \ + start.py + # rm -rf dist/PicACG + # cp Icon.icns dist/ + # ln -s /Applications/ dist/Applications + cp -avf db dist/PicACG.app/Contents/MacOS + xattr -cr dist/PicACG.app + create-dmg --volname "PicACG" --volicon "Icon.icns" --icon "PicACG.app" 200 190 \ + --window-pos 200 120 \ + --window-size 800 400 \ + --icon-size 100 \ + --hide-extension "PicACG.app" --app-drop-link 600 185 \ + ${{ env.PACKAGENAME }}.dmg dist/PicACG.app + + zip -9 bika.zip ${{ env.PACKAGENAME }}.dmg + mv ${{ env.PACKAGENAME }}.dmg .. + mv bika.zip .. + cd .. + - name: Upload + uses: actions/upload-artifact@v4 + with: + name: ${{ env.PACKAGENAME }} + path: bika.zip + retention-days: 7 + windows: runs-on: windows-latest env: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0e345ab..5ebee78 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -42,31 +42,92 @@ jobs: draft: true prerelease: true - macos-arm: + macos: needs: [setup, release] runs-on: macos-latest env: - PACKAGENAME: ${{ needs.setup.outputs.PACKAGE_PREFIX }}_macos_arm64 + PACKAGENAME: ${{ needs.setup.outputs.PACKAGE_PREFIX }}_macos_universal2 steps: - uses: actions/checkout@v4 - - name: Set up Python 3.8 + - name: Set up Python 3.10 uses: actions/setup-python@v5 with: - python-version: 3.8 + python-version: 3.10 - name: Install dependencies run: | python -m pip install --upgrade pip pip install pyinstaller - # pip install https://github.com/tonquer/waifu2x-vulkan/releases/download/v1.1.6/sr_ncnn_vulkan-1.2.0-cp39-cp39-macosx_10_9_universal2.whl - pip install -r src/requirements_macos_arm.txt + pip install https://github.com/tonquer/waifu2x-vulkan/releases/download/v1.1.6/sr_ncnn_vulkan-1.2.0-cp36.cp37.cp38.cp39.cp310.cp311.cp312.cp313-none-macosx_10_9_universal2.whl + pip install https://github.com/tonquer/waifu2x-vulkan/releases/download/v1.1.6/Pillow-9.1.1-cp310-cp310-macosx_10_10_universal2.whl + pip install -r src/requirements_macos.txt brew install create-dmg - - name: Build + - name: Build + run: | + cd src + cp ../res/icon/Icon.icns ./ + pyinstaller --target-architecture=universal2 --clean --onedir --name PicACG \ + --hidden-import sr_ncnn_vulkan --hidden-import PySide6 --hidden-import requests \ + --hidden-import urllib3 --hidden-import websocket-client --hidden-import pillow \ + --hidden-import config \ + --hidden-import component \ + --hidden-import server \ + --hidden-import task \ + --hidden-import tools \ + --hidden-import view \ + --strip --windowed -i Icon.icns \ + start.py + cp -avf db dist/PicACG.app/Contents/MacOS + xattr -cr dist/PicACG.app + create-dmg --volname "PicACG" --volicon "Icon.icns" --icon "PicACG.app" 200 190 \ + --window-pos 200 120 \ + --window-size 800 400 \ + --icon-size 100 \ + --hide-extension "PicACG.app" --app-drop-link 600 185 \ + ${{ env.PACKAGENAME }}.dmg dist/PicACG.app + + zip -9 bika.zip ${{ env.PACKAGENAME }}.dmg + mv ${{ env.PACKAGENAME }}.dmg .. + mv bika.zip .. + cd .. + - name: Upload + uses: actions/upload-artifact@v4 + with: + name: ${{ env.PACKAGENAME }} + path: bika.zip + - name: upload-macos-arm + uses: softprops/action-gh-release@v2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + files: ${{ env.PACKAGENAME }}.dmg + + macos-nosr: + needs: [setup, release] + runs-on: macos-latest + env: + PACKAGENAME: ${{ needs.setup.outputs.PACKAGE_PREFIX }}_macos_nosr_universal2 + steps: + - uses: actions/checkout@v4 + - name: Set up Python 3.10 + uses: actions/setup-python@v5 + with: + python-version: 3.10 + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install pyinstaller + # pip install https://github.com/tonquer/waifu2x-vulkan/releases/download/v1.1.6/sr_ncnn_vulkan-1.2.0-cp36.cp37.cp38.cp39.cp310.cp311.cp312.cp313-none-macosx_10_9_universal2.whl + pip install https://github.com/tonquer/waifu2x-vulkan/releases/download/v1.1.6/Pillow-9.1.1-cp310-cp310-macosx_10_10_universal2.whl + pip install -r src/requirements_macos.txt + brew install create-dmg + - name: Build run: | cd src cp ../res/icon/Icon.icns ./ - pyinstaller --clean --onedir --name PicACG \ - --hidden-import waifu2x_vulkan --hidden-import PySide6 --hidden-import requests \ + pyinstaller --target-architecture=universal2 --clean --onedir --name PicACG \ + --hidden-import sr_ncnn_vulkan --hidden-import PySide6 --hidden-import requests \ --hidden-import urllib3 --hidden-import websocket-client --hidden-import pillow \ --hidden-import config \ --hidden-import component \ diff --git a/src/requirements_macos.txt b/src/requirements_macos.txt index e9484f4..bbf8e20 100644 --- a/src/requirements_macos.txt +++ b/src/requirements_macos.txt @@ -1,9 +1,8 @@ -PySide6==6.1.3 +PySide6==6.4.3 websocket-client==0.59.0 requests==2.26.0 urllib3==1.25.11 - -pillow==8.3.2 +pillow==9.1.1 Pysocks==1.7.1 natsort==8.2.0 webdavclient3==3.14.6 diff --git a/src/requirements_macos_arm.txt b/src/requirements_macos_arm.txt deleted file mode 100644 index 306e3be..0000000 --- a/src/requirements_macos_arm.txt +++ /dev/null @@ -1,12 +0,0 @@ -PySide6==6.4.3 -websocket-client -requests -urllib3 -pillow -# waifu2x-vulkan -Pysocks -natsort -webdavclient3 -tqdm -pysmb -# pywin32==302