see if can debug this libs moving problem #63
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Compile | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
# Checkout the code | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Download and install Python debug build | |
run: | | |
curl -o python312.zip https://www.python.org/ftp/python/3.12.0/python-3.12.0-embed-amd64.zip | |
unzip python312.zip -d python312 | |
# Update PATH to point to the extracted directory | |
echo python312 >> $GITHUB_ENV | |
echo "PATH=$GITHUB_ENV/python312:$PATH" >> $GITHUB_ENV | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
# Install vcpkg (if not already installed) | |
- name: Set up vcpkg | |
run: | | |
git clone https://github.com/microsoft/vcpkg.git | |
./vcpkg/bootstrap-vcpkg.bat | |
# Install JsonCPP with vcpkg | |
- name: Install JsonCPP via vcpkg | |
run: | | |
./vcpkg/vcpkg install jsoncpp | |
./vcpkg/vcpkg integrate install # To set up vcpkg to work with CMake | |
# Build the DLL using CMake | |
- name: Build DLL using CMake | |
run: | | |
cd engine | |
mkdir build | |
cd build | |
cmake -DCMAKE_TOOLCHAIN_FILE=../../vcpkg/scripts/buildsystems/vcpkg.cmake .. | |
cmake --build . --config Debug | |
cmake --build . --config Release | |
- name: Print contents of build/bin directory | |
run: | | |
dir engine/build | |
dir engine/build/Release | |
# Move the DLL to VoiceServer directory | |
- name: Move DLL and other bits to VoiceServer directory | |
run: | | |
dir VoiceServer | |
New-Item -ItemType Directory -Force -Path VoiceServer/_libs | |
Move-Item -Force engine/build/Release/* VoiceServer/_libs/ | |
- name: Set up UV | |
uses: yezz123/setup-uv@v4 | |
- name: Sync UV dependencies | |
run: | | |
cd VoiceServer | |
uv sync | |
- name: Compile RegisterVoice.py with PyInstaller inside UV virtual environment | |
run: | | |
cd VoiceServer | |
$site_packages = uv run python -c "import site; print(site.getsitepackages()[0])" | Out-String | |
$site_packages = $site_packages.Trim() -replace "`r`n", "" # Remove any newlines | |
uv run python -m PyInstaller RegisterVoice.py --noupx --onedir --name "RegisterVoice" -i .\icon.ico --clean --add-binary "$site_packages/Lib/site-packages/azure/cognitiveservices/speech/Microsoft.CognitiveServices.Speech.core.dll;." --collect-all comtypes -y | |
- name: Compile VoiceServer.py with PyInstaller inside UV virtual environment | |
run: | | |
cd VoiceServer | |
$site_packages = uv run python -c "import site; print(site.getsitepackages()[0])" | Out-String | |
$site_packages = $site_packages.Trim() -replace "`r`n", "" # Remove any newlines | |
uv run python -m PyInstaller VoiceServer.py --noupx --onedir --noconsole --name "VoiceServer" -i .\icon.ico --clean --add-binary "$site_packages/Lib/site-packages/azure/cognitiveservices/speech/Microsoft.CognitiveServices.Speech.core.dll;." --collect-all comtypes --uac-admin -y | |
- name: Build Installer with Inno Setup | |
run: | | |
cd VoiceServer | |
& "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" ".\buildinstaller.iss" | |
- name: Zip the executables and _libs directory | |
run: | | |
cd VoiceServer | |
powershell -Command "Compress-Archive -Path dist/VoiceServer/*, dist/RegisterVoice/*, _libs -DestinationPath VoiceServer_Uninstalled.zip" | |
- name: Archive the zip of uninstalled version | |
uses: actions/upload-artifact@v4 | |
with: | |
name: uninstalled-version | |
path: VoiceServer/ VoiceServer_Uninstalled.zip | |
# Archive the compiled executables | |
- name: Archive the output | |
uses: actions/upload-artifact@v4 | |
with: | |
name: compiled-executables | |
path: | | |
VoiceServer/output/VoiceServerInstaller.exe |