chore: try fix actions

This commit is contained in:
helloplhm-qwq 2023-11-11 18:25:13 +08:00
parent 48bf01f2c5
commit 1607c4e037
No known key found for this signature in database
GPG Key ID: 6BE1B64B905567C7
2 changed files with 14 additions and 11 deletions

View File

@ -12,27 +12,29 @@ jobs:
build-exe: build-exe:
runs-on: windows-latest runs-on: windows-latest
steps: steps:
- name: checkout - name: Checkout git repo
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: setup python 3.11 - name: Setup Python 3.11
uses: actions/setup-python@v2 uses: actions/setup-python@v2
with: with:
python-version: '3.11' python-version: '3.11'
- name: install pyinstaller - name: Install pyinstaller
run: python -m pip install pyinstaller run: python -m pip install pyinstaller
- name: install dependencies - name: Install dependencies
run: python -m pip install -r ./requirements.txt run: python -m pip install -r ./requirements.txt
- name: build exe - name: Build EXE
env:
actions: T
run: pyinstaller -F main.py run: pyinstaller -F main.py
- name: rename - name: Rename
run: Rename-Item ./dist/main.exe ./dist/lx-music-api-server_$(git rev-parse --short HEAD).exe run: Rename-Item ./dist/main.exe ./dist/lx-music-api-server_$(git rev-parse --short HEAD).exe
- name: upload - name: Upload
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
with: with:
name: lx-music-api-server name: lx-music-api-server

View File

@ -169,6 +169,7 @@ def handle_default_config():
f.write(json.dumps(default, indent=2, ensure_ascii=False, f.write(json.dumps(default, indent=2, ensure_ascii=False,
escape_forward_slashes=False)) escape_forward_slashes=False))
f.close() f.close()
if (not os.getenv('actions')):
logger.info('首次启动或配置文件被删除,已创建默认配置文件') logger.info('首次启动或配置文件被删除,已创建默认配置文件')
logger.info( logger.info(
f'\n请到{variable.workdir + os.path.sep}config.json修改配置后重新启动服务器') f'\n请到{variable.workdir + os.path.sep}config.json修改配置后重新启动服务器')