update #48
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: release | |
on: | |
push: | |
tags: | |
- '*' | |
workflow_dispatch: | |
jobs: | |
setup: | |
runs-on: ubuntu-latest | |
outputs: | |
PACKAGE_PREFIX: ${{ steps.get-package_prefix.outputs.PACKAGE_PREFIX }} | |
TAG_NAME: ${{ steps.get-package_prefix.outputs.TAG_NAME }} | |
HEAD_SHA_SHORT: ${{ steps.get-package_prefix.outputs.HEAD_SHA_SHORT }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: '0' | |
- name: get-package_prefix | |
id: get-package_prefix | |
run: | | |
LIB_NAME=bika | |
TAG_NAME=$(git describe --abbrev=0 --tags) | |
HEAD_SHA_SHORT=$(git rev-parse --short HEAD) | |
echo "::set-output name=PACKAGE_PREFIX::${LIB_NAME}_${TAG_NAME}" | |
echo "::set-output name=TAG_NAME::${TAG_NAME}" | |
echo "::set-output name=HEAD_SHA_SHORT::${HEAD_SHA_SHORT}" | |
release: | |
needs: [setup] | |
runs-on: ubuntu-latest | |
outputs: | |
Up_Url: ${{ steps.create_release.outputs.upload_url }} | |
steps: | |
- name: create_release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ needs.setup.outputs.TAG_NAME }} | |
release_name: ${{ needs.setup.outputs.TAG_NAME }} | |
draft: true | |
prerelease: true | |
macos-arm: | |
needs: [setup, release] | |
runs-on: macos-latest | |
env: | |
PACKAGENAME: ${{ needs.setup.outputs.PACKAGE_PREFIX }}_macos_arm64 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.8 | |
- 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 | |
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 \ | |
--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 | |
windows: | |
needs: [setup, release] | |
runs-on: windows-latest | |
env: | |
PACKAGENAME: ${{ needs.setup.outputs.PACKAGE_PREFIX }}_windows_x64 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.7 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.7 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pyinstaller==4.8 | |
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-none-win_amd64.whl | |
pip install -r src\requirements.txt | |
- name: Build | |
run: | | |
cd src | |
cp ..\res\icon\icon.ico .\ | |
pyinstaller -F -w -i icon.ico start.py | |
mv dist bika | |
Copy-Item -Verbose -Recurse -Path db -Destination bika/ | |
cp ..\LICENSE bika\ | |
cp ..\CHANGELOG bika\ | |
cd .. | |
mkdir ${{ env.PACKAGENAME }} | |
mv src\bika ${{ env.PACKAGENAME }} | |
7z a -t7z -r "$($Env:PACKAGENAME + '.7z')" "bika" | |
- name: Upload | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.PACKAGENAME }} | |
path: bika | |
- name: upload-win | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ needs.release.outputs.Up_Url }} | |
asset_path: ${{ env.PACKAGENAME }}.7z | |
asset_name: ${{ env.PACKAGENAME }}.7z | |
asset_content_type: application/zip | |
windows-nosr: | |
needs: [setup, release] | |
runs-on: windows-latest | |
env: | |
PACKAGENAME: ${{ needs.setup.outputs.PACKAGE_PREFIX }}_windows_nosr_x64 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.7 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.7 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pyinstaller==4.8 | |
pip install -r src\requirements.txt | |
- name: Build | |
run: | | |
cd src | |
cp ..\res\icon\icon.ico .\ | |
pyinstaller -F -w -i icon.ico start.py | |
mv dist bika | |
Copy-Item -Verbose -Recurse -Path db -Destination bika/ | |
cp ..\LICENSE bika\ | |
cp ..\CHANGELOG bika\ | |
cd .. | |
mkdir ${{ env.PACKAGENAME }} | |
mv src\bika ${{ env.PACKAGENAME }} | |
7z a -t7z -r "$($Env:PACKAGENAME + '.7z')" "bika" | |
- name: Upload | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.PACKAGENAME }} | |
path: bika | |
- name: upload-win | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ needs.release.outputs.Up_Url }} | |
asset_path: ${{ env.PACKAGENAME }}.7z | |
asset_name: ${{ env.PACKAGENAME }}.7z | |
asset_content_type: application/zip | |
windows7: | |
needs: [setup, release] | |
runs-on: windows-latest | |
env: | |
PACKAGENAME: ${{ needs.setup.outputs.PACKAGE_PREFIX }}_windows7_x64 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.7 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.7 | |
- 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-cp36.cp37.cp38.cp39.cp310.cp311-none-win_amd64.whl | |
pip install -r src\requirements_win7.txt | |
- name: Build | |
run: | | |
cd src | |
cp ..\res\icon\icon.ico .\ | |
pyinstaller -F -w -i icon.ico start.py | |
mv dist bika | |
Copy-Item -Verbose -Recurse -Path db -Destination bika/ | |
cp ..\LICENSE bika\ | |
cp ..\CHANGELOG bika\ | |
cd .. | |
mkdir ${{ env.PACKAGENAME }} | |
mv src\bika ${{ env.PACKAGENAME }} | |
7z a -t7z -r "$($Env:PACKAGENAME + '.7z')" "bika" | |
- name: Upload | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.PACKAGENAME }} | |
path: bika | |
- name: upload-win | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ needs.release.outputs.Up_Url }} | |
asset_path: ${{ env.PACKAGENAME }}.7z | |
asset_name: ${{ env.PACKAGENAME }}.7z | |
asset_content_type: application/zip | |
windows7-nosr: | |
needs: [setup, release] | |
runs-on: windows-latest | |
env: | |
PACKAGENAME: ${{ needs.setup.outputs.PACKAGE_PREFIX }}_windows7_nosr_x64 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.7 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.7 | |
- 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-cp36.cp37.cp38.cp39.cp310.cp311-none-win_amd64.whl | |
pip install -r src\requirements_win7.txt | |
- name: Build | |
run: | | |
cd src | |
cp ..\res\icon\icon.ico .\ | |
pyinstaller -F -w -i icon.ico start.py | |
mv dist bika | |
Copy-Item -Verbose -Recurse -Path db -Destination bika/ | |
cp ..\LICENSE bika\ | |
cp ..\CHANGELOG bika\ | |
cd .. | |
mkdir ${{ env.PACKAGENAME }} | |
mv src\bika ${{ env.PACKAGENAME }} | |
7z a -t7z -r "$($Env:PACKAGENAME + '.7z')" "bika" | |
- name: Upload | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.PACKAGENAME }} | |
path: bika | |
- name: upload-win | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ needs.release.outputs.Up_Url }} | |
asset_path: ${{ env.PACKAGENAME }}.7z | |
asset_name: ${{ env.PACKAGENAME }}.7z | |
asset_content_type: application/zip |