test github action windows installer

This commit is contained in:
Daniel Gatis 2024-01-31 13:03:34 -03:00
parent c19aacb4ba
commit 0dcdb080ae
5 changed files with 18 additions and 10 deletions

View File

@ -1,4 +1,5 @@
name: Build Windows Installer name: Build Windows Installer
on: on:
push: push:
tags: tags:
@ -11,9 +12,17 @@ jobs:
- uses: actions/setup-python@v5 - uses: actions/setup-python@v5
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- shell: pwsh - shell: pwsh
run: ./build-exe.ps1 run: ./_build-exe.ps1
- name: Compile .ISS to .EXE Installer - name: Compile .ISS to .EXE Installer
uses: Minionguyjpro/Inno-Setup-Action@v1.2.2 uses: Minionguyjpro/Inno-Setup-Action@v1.2.2
with: with:
path: setup.iss path: _setup.iss
options: /O+ options: /O+
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/rembg-cli-installer.exe
asset_name: rembg-cli-installer.exe
tag: ${{ github.ref }}
overwrite: true

View File

@ -1,8 +1,9 @@
# Install required packages # Install required packages
pip install pyinstaller
pip install -e ".[cli]" pip install -e ".[cli]"
# Create PyInstaller spec file with specified data collections # Create PyInstaller spec file with specified data collections
pyi-makespec --collect-data=gradio_client --collect-data=gradio rembg.py # pyi-makespec --collect-data=gradio_client --collect-data=gradio rembg.py
# Run PyInstaller with the generated spec file # Run PyInstaller with the generated spec file
pyinstaller rembg.spec pyinstaller rembg.spec

View File

@ -3,9 +3,10 @@
#define MyAppPublisher "danielgatis" #define MyAppPublisher "danielgatis"
#define MyAppURL "https://github.com/danielgatis/rembg" #define MyAppURL "https://github.com/danielgatis/rembg"
#define MyAppExeName "rembg.exe" #define MyAppExeName "rembg.exe"
#define MyAppId "49AB7484-212F-4B31-A49F-533A480F3FD4"
[Setup] [Setup]
AppId={{49AB7484-212F-4B31-A49F-533A480F3FD4} AppId={#MyAppId}
AppName={#MyAppName} AppName={#MyAppName}
AppVersion={#MyAppVersion} AppVersion={#MyAppVersion}
AppPublisher={#MyAppPublisher} AppPublisher={#MyAppPublisher}
@ -15,7 +16,7 @@ AppUpdatesURL={#MyAppURL}
DefaultDirName={autopf}\{#MyAppName} DefaultDirName={autopf}\{#MyAppName}
DefaultGroupName={#MyAppName} DefaultGroupName={#MyAppName}
DisableProgramGroupPage=yes DisableProgramGroupPage=yes
OutputBaseFilename=setup OutputBaseFilename=rembg-cli-installer
Compression=lzma Compression=lzma
SolidCompression=yes SolidCompression=yes
WizardStyle=modern WizardStyle=modern
@ -35,9 +36,6 @@ Name: modifypath; Description: "Add to PATH variable"
[Icons] [Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}" Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
[Run]
Filename: "{app}\{#MyAppExeName}"; Parameters: "--version"; Flags: runhidden
[Code] [Code]
const const
ModPathName = 'modifypath'; ModPathName = 'modifypath';
@ -48,4 +46,4 @@ begin
setArrayLength(Result, 1) setArrayLength(Result, 1)
Result[0] := ExpandConstant('{app}'); Result[0] := ExpandConstant('{app}');
end; end;
#include "modpath.iss" #include "_modpath.iss"

View File

@ -4,7 +4,7 @@ from PyInstaller.utils.hooks import collect_data_files
datas = [] datas = []
datas += collect_data_files('gradio_client') datas += collect_data_files('gradio_client')
datas += collect_data_files('gradio') datas += collect_data_files('gradio')
datas += collect_data_files('onnxruntime')
a = Analysis( a = Analysis(
['rembg.py'], ['rembg.py'],