Update build.yml #167
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 | |
on: | |
push: | |
branches: ["*"] | |
pull_request: | |
branches: [main] | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout code | |
uses: actions/[email protected] | |
- name: Set up Python with caching | |
uses: actions/[email protected] | |
with: | |
python-version: '3.10' | |
cache: 'pip' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pyinstaller -r requirements.txt | |
- name: Build with PyInstaller | |
run: > | |
pyinstaller --noconfirm --clean --onefile | |
--add-binary "7z/7z.exe;7z" | |
--name DazContentInstaller | |
main.pyw | |
- name: Prepare distribution package | |
shell: pwsh | |
run: | | |
$targetDir = "dist/DazContentInstaller" | |
New-Item -Path $targetDir -ItemType Directory -Force | |
Copy-Item config.ini -Destination $targetDir/ | |
Move-Item dist/DazContentInstaller.exe -Destination $targetDir/ | |
- name: Upload Artifacts | |
uses: actions/[email protected] | |
with: | |
name: DazContentInstaller | |
path: dist/DazContentInstaller |