-
Notifications
You must be signed in to change notification settings - Fork 197
102 lines (85 loc) · 2.81 KB
/
pack.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
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