Skip to content

Commit

Permalink
Create python-app.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
HighDoping authored Sep 28, 2024
1 parent 75bf554 commit 04a439d
Showing 1 changed file with 76 additions and 0 deletions.
76 changes: 76 additions & 0 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Build Python application

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

permissions:
contents: read

jobs:
build:
runs-on: windows-latest

steps:
# Step 1: Checkout the repository
- name: Checkout Repository
uses: actions/checkout@v4

# Step 2: Set up Python
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12' # Specify your Python version

# Step 3: Install Poetry
- name: Install Poetry
run: |
(Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | python -
$env:PATH += ";$HOME\.poetry\bin"
echo "POETRY_HOME=$HOME\.poetry" >> $GITHUB_ENV
echo "PATH=$PATH;$HOME\.poetry\bin" >> $GITHUB_ENV
# Step 4: Install Dependencies
- name: Install Dependencies
run: |
cd src
poetry install --with dev
# **New Step: Run Additional Scripts (Download Libraries and Models)**
- name: Download Libraries and Models
run: |
cd src
poetry run python ./dev/download_libsimple.py
poetry run python ./dev/download_models.py
# Step 5: Build the Application
- name: Build Application
run: |
cd src
poetry run python build.py
# Step 6: Install Chocolatey (Package Manager for Windows)
- name: Install Chocolatey
run: |
Set-ExecutionPolicy Bypass -Scope Process -Force
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
# Step 7: Install Inno Setup
- name: Install Inno Setup
run: choco install innosetup -y

# Step 8: Compile Installer using Inno Setup
- name: Compile Installer
run: |
cd src/dev
"C:\Program Files (x86)\Inno Setup 6\ISCC.exe" setup.iss
# Step 9: Upload the Installer as an Artifact (Optional)
- name: Upload Installer Artifact
uses: actions/upload-artifact@v3
with:
name: PicFinder-Installer
path: src/installer_dist/PicFinder\ Installer.exe

0 comments on commit 04a439d

Please sign in to comment.