Skip to content

Commit

Permalink
增加github action
Browse files Browse the repository at this point in the history
  • Loading branch information
FishHawk committed Oct 28, 2024
1 parent d884d39 commit 827df1b
Show file tree
Hide file tree
Showing 7 changed files with 101 additions and 13 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: build

on:
workflow_dispatch: # allows manual triggering
inputs:
create_release:
description: "Create new release"
required: true
type: boolean
push:
branches:
- main
paths: [".github/workflows/build.yml", "main.spec", "**/*.py"]
pull_request:
types: [opened, synchronize, reopened]
paths: ["**/*.py"]

jobs:
windows-latest:
runs-on: windows-latest

steps:
- name: Clone
id: checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install Python Environment
id: pyenv
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
- name: Build
id: pyinstaller_build
shell: powershell
run: |
pyinstaller --clean --noconfirm main.spec
- name: Upload artifacts
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/main' ) || github.event.inputs.create_release == 'true' }}
uses: actions/upload-artifact@v3
with:
path: |
dist/main.exe
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,5 @@ __pycache__
/Release
llama
sakura-launcher_config.json
main.spec
*.gguf
*.log
native.dll
10 changes: 10 additions & 0 deletions dist.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
pyinstaller -F main.py -w \
--icon=icon.png --add-data "icon.png:." \
--add-data "cloudflared-windows-amd64.exe:." \
--hidden-import=tiktoken_ext.openai_public \
--hidden-import=tiktoken_ext \
--hidden-import=PySide6 \
--hidden-import=PySide6.QtCore \
--hidden-import=PySide6.QtGui \
--hidden-import=qfluentwidgets \
--clean
8 changes: 0 additions & 8 deletions justfile

This file was deleted.

39 changes: 39 additions & 0 deletions main.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# -*- mode: python ; coding: utf-8 -*-


a = Analysis(
['main.py'],
pathex=[],
binaries=[],
datas=[('icon.png', '.'), ('cloudflared-windows-amd64.exe', '.')],
hiddenimports=['tiktoken_ext.openai_public', 'tiktoken_ext', 'PySide6', 'PySide6.QtCore', 'PySide6.QtGui', 'qfluentwidgets'],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[],
noarchive=False,
optimize=0,
)
pyz = PYZ(a.pure)

exe = EXE(
pyz,
a.scripts,
a.binaries,
a.datas,
[],
name='main',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=False,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
icon=['icon.png'],
)
1 change: 0 additions & 1 deletion pyinstaller.txt

This file was deleted.

3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
numpy<2
PySide6==6.6.2
PySide6-Fluent-Widgets[full]
PySide6-Fluent-Widgets
wmi
requests
py7zr
Expand Down

0 comments on commit 827df1b

Please sign in to comment.