Selaa lähdekoodia

test github action windows installer

Daniel Gatis 1 vuosi sitten
vanhempi
commit
0dcdb080ae
5 muutettua tiedostoa jossa 18 lisäystä ja 10 poistoa
  1. 11 2
      .github/workflows/windows_installer.yml
  2. 2 1
      _build-exe.ps1
  3. 0 0
      _modpath.iss
  4. 4 6
      _setup.iss
  5. 1 1
      rembg.spec

+ 11 - 2
.github/workflows/windows_installer.yml

@@ -1,4 +1,5 @@
 name: Build Windows Installer
+
 on:
     push:
         tags:
@@ -11,9 +12,17 @@ jobs:
       - uses: actions/setup-python@v5
       - uses: actions/checkout@v4
       - shell: pwsh
-        run: ./build-exe.ps1
+        run: ./_build-exe.ps1
       - name: Compile .ISS to .EXE Installer
         uses: Minionguyjpro/[email protected]
         with:
-          path: setup.iss
+          path: _setup.iss
           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

+ 2 - 1
build-exe.ps1 → _build-exe.ps1

@@ -1,8 +1,9 @@
 # Install required packages
+pip install pyinstaller
 pip install -e ".[cli]"
 
 # 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
 pyinstaller rembg.spec

+ 0 - 0
modpath.iss → _modpath.iss


+ 4 - 6
setup-exe.iss → _setup.iss

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

+ 1 - 1
rembg.spec

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