Skip to content

Pack Flet Application #4

Pack Flet Application

Pack Flet Application #4

Workflow file for this run

name: Pack Flet Application
on:
push:
branches:
- main
paths:
- '**.py'
tags:
- "v*.*.*"
pull_request:
branches:
- main
workflow_dispatch: ~
permissions:
contents: write
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
cache: "pip"
- name: Install dependencies
run:
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements_notif.txt
- name: Pack Flet Application
run: flet pack gui.py --icon imgs/icon.ico --uac-admin --add-data "utils/models;utils/models" -y
- name: Pyinstaller Application
run: |
pyinstaller --uac-admin -F --i imgs/icon.png -w notif.py
- name: Move assets to dist directory
run: |
xcopy imgs dist\imgs /I /E
xcopy actions dist\actions /I /E
xcopy info_example.yml dist
xcopy info_example_old.yml dist
xcopy README.md dist
ren dist AutoSimulatedUniverse
- name: Create zip archive
if: startsWith(github.ref, 'refs/tags/')
run: |
Rename-Item -Path AutoSimulatedUniverse -NewName AutoSimulatedUniverse_${{ github.ref_name }}
Compress-Archive -Path AutoSimulatedUniverse_${{ github.ref_name }}\ -DestinationPath AutoSimulatedUniverse_${{ github.ref_name }}.zip -Force
- name: Create release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
name: AutoSimulatedUniverse_${{ github.ref_name }}
files: |
AutoSimulatedUniverse_${{ github.ref_name }}.zip
prerelease: true
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: AutoSimulatedUniverse
path: AutoSimulatedUniverse