Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
新增macos universal2版本
  • Loading branch information
tonquer committed Nov 6, 2024
1 parent a70000a commit cee18ea
Show file tree
Hide file tree
Showing 4 changed files with 137 additions and 33 deletions.
74 changes: 65 additions & 9 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down Expand Up @@ -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:
Expand Down
79 changes: 70 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
5 changes: 2 additions & 3 deletions src/requirements_macos.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
12 changes: 0 additions & 12 deletions src/requirements_macos_arm.txt

This file was deleted.

0 comments on commit cee18ea

Please sign in to comment.