通过快捷方式获取路径 #24
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: Build realtime release | |
on: | |
workflow_dispatch: | |
pull_request: | |
paths: | |
- '**.py' | |
push: | |
branches: | |
- main | |
paths: | |
- '**.py' | |
permissions: | |
contents: write | |
jobs: | |
build: | |
name: Build | |
runs-on: windows-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
submodules: 'false' | |
- name: Set up python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.12.0' | |
cache: 'pip' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt pyinstaller | |
- name: Generate program | |
run: | | |
pyinstaller -D --distpath .\dist\ -i .\assets\logo\Terminal.ico --contents-directory libraries --exclude-module PyQt5 --uac-admin -n "March7th Assistant" main.py -y | |
pyinstaller -D --distpath .\dist\ -i .\assets\logo\March7th.ico --contents-directory libraries --exclude-module cv2 --exclude-module numpy --uac-admin -n "March7th Launcher" app.py -y -w | |
pyinstaller -F --distpath .\dist\March7thAssistant\ -i .\assets\logo\Update.ico -n "Update" update.py -y | |
- name: Move assets to dist directory | |
run: | | |
xcopy /E /Y ".\dist\March7th Assistant\*" ".\dist\March7thAssistant\" | |
xcopy /E /Y ".\dist\March7th Launcher\*" ".\dist\March7thAssistant\" | |
xcopy /E /I /Y .\assets\ .\dist\March7thAssistant\assets\ | |
xcopy /Y .\README.md .\dist\March7thAssistant\ | |
- name: Create zip archive | |
run: | | |
ren .\dist\March7thAssistant March7thAssistant_${{ github.run_number }} | |
powershell Compress-Archive -Path .\dist\March7thAssistant_${{ github.run_number }}\ -DestinationPath .\dist\March7thAssistant_${{ github.run_number }}.zip -Force | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: March7thAssistant_${{ github.run_number }}.zip | |
path: ./dist/March7thAssistant_${{ github.run_number }}.zip | |