mirror of
https://github.com/Yonokid/PyTaiko.git
synced 2026-02-04 19:50:12 +01:00
Update python-app.yml
This commit is contained in:
66
.github/workflows/python-app.yml
vendored
66
.github/workflows/python-app.yml
vendored
@@ -40,13 +40,35 @@ jobs:
|
|||||||
- name: Install Audio Dependencies (Windows)
|
- name: Install Audio Dependencies (Windows)
|
||||||
if: runner.os == 'Windows'
|
if: runner.os == 'Windows'
|
||||||
run: |
|
run: |
|
||||||
# Using vcpkg for Windows dependencies
|
# Install vcpkg dependencies
|
||||||
|
vcpkg integrate install
|
||||||
vcpkg install portaudio:x64-windows libsndfile:x64-windows libsamplerate:x64-windows
|
vcpkg install portaudio:x64-windows libsndfile:x64-windows libsamplerate:x64-windows
|
||||||
# Set environment variables for linking
|
|
||||||
|
# Set up environment variables for the build system
|
||||||
echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" >> $env:GITHUB_ENV
|
echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" >> $env:GITHUB_ENV
|
||||||
echo "PKG_CONFIG_PATH=$env:VCPKG_INSTALLATION_ROOT/installed/x64-windows/lib/pkgconfig" >> $env:GITHUB_ENV
|
echo "CMAKE_TOOLCHAIN_FILE=$env:VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" >> $env:GITHUB_ENV
|
||||||
|
|
||||||
|
# Set up include and library paths
|
||||||
|
$vcpkgPath = "$env:VCPKG_INSTALLATION_ROOT/installed/x64-windows"
|
||||||
|
echo "CPPFLAGS=-I$vcpkgPath/include" >> $env:GITHUB_ENV
|
||||||
|
echo "LDFLAGS=-L$vcpkgPath/lib" >> $env:GITHUB_ENV
|
||||||
|
echo "PKG_CONFIG_PATH=$vcpkgPath/lib/pkgconfig" >> $env:GITHUB_ENV
|
||||||
|
|
||||||
|
# Add bin directory to PATH for runtime DLLs
|
||||||
|
echo "$vcpkgPath/bin" >> $env:GITHUB_PATH
|
||||||
shell: powershell
|
shell: powershell
|
||||||
|
|
||||||
|
# Set up build tools for Windows
|
||||||
|
- name: Setup MSVC (Windows)
|
||||||
|
if: runner.os == 'Windows'
|
||||||
|
uses: microsoft/setup-msbuild@v2
|
||||||
|
|
||||||
|
- name: Setup MSVC Environment (Windows)
|
||||||
|
if: runner.os == 'Windows'
|
||||||
|
uses: ilammy/msvc-dev-cmd@v1
|
||||||
|
with:
|
||||||
|
arch: x64
|
||||||
|
|
||||||
# Compile the audio library
|
# Compile the audio library
|
||||||
- name: Check Audio Library Dependencies
|
- name: Check Audio Library Dependencies
|
||||||
run: |
|
run: |
|
||||||
@@ -55,7 +77,19 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
|
|
||||||
- name: Compile Audio Library
|
- name: Compile Audio Library (Windows)
|
||||||
|
if: runner.os == 'Windows'
|
||||||
|
run: |
|
||||||
|
cd libs/audio
|
||||||
|
make clean
|
||||||
|
# Use environment variables set above
|
||||||
|
make all CC=cl CFLAGS="/I%VCPKG_INSTALLATION_ROOT%/installed/x64-windows/include" LDFLAGS="/LIBPATH:%VCPKG_INSTALLATION_ROOT%/installed/x64-windows/lib"
|
||||||
|
shell: cmd
|
||||||
|
env:
|
||||||
|
VCPKG_INSTALLATION_ROOT: ${{ env.VCPKG_ROOT }}
|
||||||
|
|
||||||
|
- name: Compile Audio Library (Unix)
|
||||||
|
if: runner.os != 'Windows'
|
||||||
run: |
|
run: |
|
||||||
cd libs/audio
|
cd libs/audio
|
||||||
make clean
|
make clean
|
||||||
@@ -69,13 +103,27 @@ jobs:
|
|||||||
sudo make install
|
sudo make install
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Copy Audio Library to System Path (Windows)
|
- name: Setup Audio Library (Windows)
|
||||||
if: runner.os == 'Windows'
|
if: runner.os == 'Windows'
|
||||||
run: |
|
run: |
|
||||||
cd libs/audio
|
cd libs/audio
|
||||||
# Copy DLL to a location where Python can find it
|
# Create build directory and copy library files
|
||||||
mkdir -p ../../build/lib
|
mkdir -p ../../build/lib
|
||||||
cp libaudio.dll ../../build/lib/
|
|
||||||
|
# Copy the compiled library
|
||||||
|
if (Test-Path "libaudio.dll") {
|
||||||
|
Copy-Item "libaudio.dll" "../../build/lib/"
|
||||||
|
}
|
||||||
|
if (Test-Path "audio.dll") {
|
||||||
|
Copy-Item "audio.dll" "../../build/lib/"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Copy vcpkg DLLs that might be needed at runtime
|
||||||
|
$vcpkgBin = "$env:VCPKG_INSTALLATION_ROOT/installed/x64-windows/bin"
|
||||||
|
if (Test-Path $vcpkgBin) {
|
||||||
|
Copy-Item "$vcpkgBin/*.dll" "../../build/lib/" -ErrorAction SilentlyContinue
|
||||||
|
}
|
||||||
|
|
||||||
# Add to PATH
|
# Add to PATH
|
||||||
echo "${{ github.workspace }}/build/lib" >> $env:GITHUB_PATH
|
echo "${{ github.workspace }}/build/lib" >> $env:GITHUB_PATH
|
||||||
shell: powershell
|
shell: powershell
|
||||||
@@ -105,8 +153,8 @@ jobs:
|
|||||||
|
|
||||||
# Copy the compiled audio library to release
|
# Copy the compiled audio library to release
|
||||||
if [ "${{ runner.os }}" == "Windows" ]; then
|
if [ "${{ runner.os }}" == "Windows" ]; then
|
||||||
cp libs/audio/libaudio.dll release/ 2>/dev/null || true
|
cp libs/audio/*.dll release/ 2>/dev/null || true
|
||||||
cp build/lib/libaudio.dll release/ 2>/dev/null || true
|
cp build/lib/*.dll release/ 2>/dev/null || true
|
||||||
elif [ "${{ runner.os }}" == "macOS" ]; then
|
elif [ "${{ runner.os }}" == "macOS" ]; then
|
||||||
cp libs/audio/libaudio.dylib release/ 2>/dev/null || true
|
cp libs/audio/libaudio.dylib release/ 2>/dev/null || true
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user