diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 08a1471a..c9e3efbb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -62,7 +62,7 @@ jobs: fi shell: bash - name: Test - run: poetry run make libwhisper.so test + run: poetry run make test build: runs-on: ${{ matrix.os }} @@ -107,11 +107,11 @@ jobs: - name: Bundle run: | if [ "$RUNNER_OS" == "macOS" ]; then - poetry run make libwhisper.so bundle_mac + poetry run make bundle_mac elif [ "$RUNNER_OS" == "Windows" ]; then - poetry run make libwhisper.so bundle_windows + poetry run make dist/Buzz.exe elif [ "$RUNNER_OS" == "Linux" ]; then - poetry run make libwhisper.so bundle_linux + poetry run make bundle_linux fi env: BUZZ_VERSION: ${{ github.ref_name }} @@ -122,6 +122,7 @@ jobs: path: | dist/Buzz*.tar.gz dist/Buzz*.zip + dist/Buzz*.exe release: runs-on: ubuntu-latest @@ -140,3 +141,4 @@ jobs: files: | Buzz*.tar.gz Buzz*.dmg + Buzz.exe diff --git a/Makefile b/Makefile index 68e3ff4e..17648107 100644 --- a/Makefile +++ b/Makefile @@ -8,46 +8,38 @@ unix_zip_path := Buzz-${version}-unix.tar.gz windows_zip_path := Buzz-${version}-windows.tar.gz -buzz: - make clean - make libwhisper.so - pyinstaller --noconfirm Buzz.spec - -clean: - rm -rf dist/* || true - -test: - pytest --cov --cov-fail-under=69 --cov-report html - -libwhisper.so: - gcc -O3 -std=c11 -pthread -mavx -mavx2 -mfma -mf16c -fPIC -c whisper.cpp/ggml.c -o whisper.cpp/ggml.o - g++ -O3 -std=c++11 -pthread --shared -fPIC -static-libstdc++ whisper.cpp/whisper.cpp whisper.cpp/ggml.o -o libwhisper.so - -version: - poetry version ${version} - -bundle_linux: - make buzz +bundle_linux: dist/Buzz cd dist && tar -czf ${unix_zip_path} Buzz/ && cd - -bundle_windows: - make buzz - cd dist && tar -czf ${windows_zip_path} Buzz/ && cd - +dist/Buzz.exe: dist/Buzz + iscc //DAppVersion=${version} installer.iss -# MAC - -bundle_mac: - make buzz +bundle_mac: dist/Buzz make zip_mac -bundle_mac_local: - make buzz +bundle_mac_local: dist/Buzz make codesign_all_mac make zip_mac make notarize_zip make staple_app_mac make dmg_mac +clean: + rm -rf dist/* || true + +test: libwhisper.so + pytest --cov --cov-fail-under=69 --cov-report html + +dist/Buzz: libwhisper.so + pyinstaller --noconfirm Buzz.spec + +version: + poetry version ${version} + +libwhisper.so: + gcc -O3 -std=c11 -pthread -mavx -mavx2 -mfma -mf16c -fPIC -c whisper.cpp/ggml.c -o whisper.cpp/ggml.o + g++ -O3 -std=c++11 -pthread --shared -fPIC -static-libstdc++ whisper.cpp/whisper.cpp whisper.cpp/ggml.o -o libwhisper.so + staple_app_mac: xcrun stapler staple ${mac_app_path} diff --git a/installer.iss b/installer.iss new file mode 100644 index 00000000..85a5522c --- /dev/null +++ b/installer.iss @@ -0,0 +1,45 @@ +; Script generated by the Inno Setup Script Wizard. +; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! + +#define AppName "Buzz" +#define AppExeName "Buzz.exe" +#define AppIconPath "assets\buzz.ico" +#define AppSourcePath "dist\Buzz\*" +#define OutputDir "dist" + +[Setup] +; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications. +; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) +AppId={{574290A2-EF7C-4845-85F3-BFF2F011A580} +AppName={#AppName} +AppVersion={#AppVersion} +;AppVerName={#AppName} {#AppVersion} +DefaultDirName={autopf}\{#AppName} +DisableProgramGroupPage=yes +; Uncomment the following line to run in non administrative install mode (install for current user only.) +;PrivilegesRequired=lowest +PrivilegesRequiredOverridesAllowed=dialog +OutputDir={#OutputDir} +OutputBaseFilename={#AppName} +SetupIconFile={#AppIconPath} +Compression=lzma +SolidCompression=yes +WizardStyle=modern + +[Languages] +Name: "english"; MessagesFile: "compiler:Default.isl" + +[Tasks] +Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked + +[Files] +Source: {#AppSourcePath}; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs +; NOTE: Don't use "Flags: ignoreversion" on any shared system files + +[Icons] +Name: "{autoprograms}\{#AppName}"; Filename: "{app}\{#AppExeName}" +Name: "{autodesktop}\{#AppName}"; Filename: "{app}\{#AppExeName}"; Tasks: desktopicon + +[Run] +Filename: "{app}\{#AppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(AppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent +