refactor: remove screenshot require numpy #95
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: Generate application | |
on: | |
workflow_dispatch: | |
pull_request: | |
paths: | |
- '**.py' | |
push: | |
branches: | |
- main | |
paths: | |
- '**.py' | |
tags: | |
- "v*.*.*" | |
permissions: | |
contents: write | |
jobs: | |
build: | |
name: Build | |
runs-on: windows-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
submodules: 'true' | |
- name: Set up python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11.4' | |
cache: 'pip' | |
- name: Install dependencies | |
run: | | |
python -m venv .venv | |
.venv\Scripts\activate | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt pyinstaller | |
- name: Generate program | |
run: | | |
.venv\Scripts\activate | |
pyinstaller -D --distpath .\dist\March7thAssistant\ -i .\assets\logo\Terminal.ico --exclude-module PyQt5 --uac-admin -n "March7th Assistant" main.py -y | |
pyinstaller -F --distpath .\dist\March7thAssistant\ -i .\assets\logo\March7th.ico --exclude-module cv2 --exclude-module numpy --uac-admin -n "March7th Assistant" app.py -y -w | |
- name: Move assets to dist directory | |
run: | | |
xcopy .\assets\ .\dist\March7thAssistant\assets\ /E /I /Y | |
xcopy .\3rdparty\ .\dist\March7thAssistant\3rdparty\ /E /I /Y | |
xcopy .\scripts\ .\dist\March7thAssistant\scripts\ /E /I /Y | |
powershell Copy-Item -Path .\assets\config\config.example.yaml -Destination .\dist\March7thAssistant\config.yaml -Force | |
xcopy .\README.md .\dist\March7thAssistant\ /Y | |
- name: Upload artifact | |
if: startsWith(github.ref, 'refs/heads/') || startsWith(github.ref, 'refs/pull/') | |
uses: actions/upload-artifact@v3 | |
with: | |
name: March7thAssistant | |
path: .\dist\ | |
- name: Create zip archive | |
if: startsWith(github.ref, 'refs/tags/') | |
run: | | |
ren .\dist\March7thAssistant March7thAssistant_${{ github.ref_name }} | |
powershell Compress-Archive -Path .\dist\March7thAssistant_${{ github.ref_name }}\ -DestinationPath .\dist\March7thAssistant_${{ github.ref_name }}.zip -Force | |
- name: Create release | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: softprops/action-gh-release@v1 | |
with: | |
name: March7thAssistant ${{ github.ref_name }} | |
files: ./dist/March7thAssistant_${{ github.ref_name }}.zip | |
prerelease: true | |