fix 黄泉不出祝福bug #72
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: Pack Flet Application | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- '**.py' | |
tags: | |
- "v*" | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: ~ | |
permissions: | |
contents: write | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.12' | |
cache: "pip" | |
- name: Install dependencies | |
run: | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
pip install numpy==1.26.4 | |
- name: Pack Flet Application | |
run: flet pack gui.py --icon imgs/icon_m.png --uac-admin --add-data "utils/models;utils/models" -y | |
- name: Pyinstaller Application | |
run: | | |
pyinstaller --uac-admin -F --i imgs/icon.png -w notif.py | |
- name: Move assets to dist directory | |
run: | | |
xcopy imgs dist\imgs /I /E | |
xcopy actions dist\actions /I /E | |
xcopy info_example.yml dist | |
xcopy info_example_old.yml dist | |
xcopy README.md dist | |
ren dist AutoSimulatedUniverse | |
- name: Create zip archive | |
if: startsWith(github.ref, 'refs/tags/') | |
run: | | |
$files = Get-ChildItem -Path AutoSimulatedUniverse | |
Compress-Archive -Path $files.FullName -DestinationPath "AutoSimulatedUniverse_${{ github.ref_name }}.zip" -Force | |
- name: Install dependencies for cpu mode | |
run: | | |
pip uninstall onnxruntime-directml -y | |
pip install onnxruntime | |
- name: Pack Flet Application | |
run: flet pack gui.py --icon imgs/icon_m.png --uac-admin --add-data "utils/models;utils/models" -y | |
- name: Pyinstaller Application | |
run: | | |
pyinstaller --uac-admin -F --i imgs/icon.png -w notif.py | |
- name: Move assets to dist directory | |
run: | | |
xcopy imgs dist\imgs /I /E | |
xcopy actions dist\actions /I /E | |
xcopy info_example.yml dist | |
xcopy info_example_old.yml dist | |
xcopy README.md dist | |
ren dist AutoSimulatedUniverse_cpu | |
- name: Create zip archive | |
if: startsWith(github.ref, 'refs/tags/') | |
run: | | |
$files = Get-ChildItem -Path AutoSimulatedUniverse_cpu | |
Compress-Archive -Path $files.FullName -DestinationPath "AutoSimulatedUniverse_${{ github.ref_name }}_cpu.zip" -Force | |
- name: Create release | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: softprops/action-gh-release@v1 | |
with: | |
name: ${{ github.ref_name }} | |
files: | | |
AutoSimulatedUniverse_${{ github.ref_name }}.zip | |
AutoSimulatedUniverse_${{ github.ref_name }}_cpu.zip | |
prerelease: true | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: AutoSimulatedUniverse | |
path: AutoSimulatedUniverse |