add build workflow

This commit is contained in:
Mathieu Broillet 2024-08-30 12:20:41 +02:00
parent 76c9ce8fe5
commit bb2ca02401
Signed by: mathieu
GPG Key ID: A08E484FE95074C1
3 changed files with 45 additions and 0 deletions

25
.github/workflows/build-release.yml vendored Normal file
View File

@ -0,0 +1,25 @@
name: Build and release
on:
push:
branches:
- main
tags:
- v*
jobs:
pyinstaller-build:
runs-on: ubuntu-latest
steps:
- name: Create Executable
uses: sayyid5416/pyinstaller@v1
with:
python_ver: '3.12'
spec: 'build.spec'
requirements: 'requirements.txt'
upload_exe_with_name: 'ai-suite-rocm-${{ github.ref_name }}'
- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: dist/*

18
build.sh Normal file
View File

@ -0,0 +1,18 @@
VERSION=1.0.0
rm -rf buildenv build dist *.spec
python -m venv buildenv
source buildenv/bin/activate
#pip install -r requirements.txt # more junk
CFLAGS="-g0 -Wl,--strip-all" \
pip install \
--no-cache-dir \
--compile \
--global-option=build_ext \
--global-option="-j 4" \
-r requirements.txt # cleaner (less junk)
pip install pyinstaller
pyinstaller --noconfirm --onefile --console --add-data services:services --name ai-suite-rocm_${VERSION}_linux_x86_64 "main.py"
deactivate
rm -rf buildenv

2
requirements.txt Normal file
View File

@ -0,0 +1,2 @@
questionary~=2.0.1
psutil~=6.0.0