8000
Skip to content
/ csound Public

Merge pull request #2528 from csound/bugfix/arraytype #4802

Merge pull request #2528 from csound/bugfix/arraytype

Merge pull request #2528 from csound/bugfix/arraytype #4802

Workflow file for this run

10BC0 10BC0
name: csound_builds
env:
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
on:
push:
branches:
- master
- develop
pull_request:
branches:
- develop
concurrency:
group: ${{ github.ref }}
jobs:
update_version:
name: Update Csound Version
runs-on: ubuntu-latest
outputs:
version: ${{ steps.tag.outputs.new_tag }}
release: ${{ steps.check_pr.outputs.has_label }}
steps:
- name: Checkout code
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Update version
id: tag
uses: anothrNick/github-tag-action@1.36.0
env:
PRERELEASE: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DRY_RUN: true
- name: Check for release label
id: check_pr
uses: ./.github/actions/check-pr-label
with:
label: release
github_token: ${{ secrets.GITHUB_TOKEN }}
linux_build:
name: Linux/Ubuntu build (apt-get)
runs-on: ubuntu-latest
steps:
- name: Checkout Source Code
uses: actions/checkout@v5
with:
fetch-depth: 1
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install cmake libgtest-dev libsndfile1-dev libasound2-dev libjack-dev portaudio19-dev libportmidi-dev libpulse-dev swig liblua5.1-0-dev default-jdk liblo-dev ladspa-sdk dssi-dev bison flex gettext libsamplerate0-dev libpipewire-0.3-dev
- name: Configure build
run: |
mkdir build
cd build
cmake .. -DUSE_MP3=0 -DUSE_DOUBLE=0 -DBUILD_TESTS=1 -DBUILD_STATIC_LIBRARY=1
- name: Build Csound
run: |
cd build
make
- name: Run tests
run: |
cd build
make test
make csdtests
linux_build_vcpkg:
name: Linux/Ubuntu build (vcpkg)
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v5
with:
fetch-depth: 1
submodules: true
- uses: lukka/get-cmake@v3.29.0
- name: Export GitHub Actions cache environment variables
uses: actions/github-script@v6
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Bootstrap VCPKG
run: ./vcpkg/bootstrap-vcpkg.sh
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install cmake libjack-dev libpulse-dev ladspa-sdk dssi-dev autoconf libtool
- name: Configure Build
run: cmake -B build -S . -DBUILD_TESTS=1 -DUSE_VCPKG=1 -DCUSTOM_CMAKE="./platform/linux/custom.cmake"
- name: Build Csound
run: cmake --build build --config Release
- name: Run integration and unit tests
run: cmake --build build --target test csdtests
iOS_build:
name: Csound for iOS
runs-on: macos-latest
needs: update_version
env:
CSOUND_VERSION: ${{ needs.update_version.outputs.version }}
steps:
- name: Install dependencies
run: brew install bison flex
- name: Checkout Source Code
uses: actions/checkout@v5
with:
fetch-depth: 1
- name: Build libsndfile xcframework
working-directory: iOs
run: |
chmod +x build_libsndfile.sh
./build_libsndfile.sh
- name: Build Csound iOS xcframework
working-directory: iOs
run: |
./build.sh
- uses: actions/upload-artifact@v4
if: github.ref == 'refs/heads/develop'
with:
name: Csound-For-iOS-${{env.CSOUND_VERSION}}
path: iOS/Csound-For-iOS
ios_build_ioscross:
name: iOS build (ioscross/vcpkg)
runs-on: ubuntu-latest
env:
VERSION: v1
steps:
- name: Checkout source code
uses: actions/checkout@v5
with:
fetch-depth: 1
submodules: true
- uses: lukka/get-cmake@v3.29.0
- name: Export GitHub Actions cache environment variables
uses: actions/github-script@v6
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Bootstrap VCPKG
run: ./vcpkg/bootstrap-vcpkg.sh
- name: Log in to GHCR
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin
- name: Configure Build
run: |
docker run --rm \
-v "${{ github.workspace }}:${{ github.workspace }}" \
--workdir "${{ github.workspace }}" \
ghcr.io/${{ github.repository_owner }}/csound-ioscross:${{ env.VERSION }} \
/bin/sh -lc '
$(eval /ioscross/arm64/ioscross_conf.sh)
cmake -B build/arm64 -S . -DUSE_VCPKG=1 -DCUSTOM_CMAKE=./platform/ioscross/custom-ios.cmake \
-DIOS=1 \
-DCMAKE_SYSTEM_NAME=iOS \
-DOSXCROSS_SDK=${OSXCROSS_SDK} \
-DOSXCROSS_TARGET=${OSXCROSS_TARGET} \
-Darch=arm64 \
-DCMAKE_OSX_ARCHITECTURES=arm64
'
- name: Build Csound
run: |
docker run --rm \
-v "${{ github.workspace }}:${{ github.workspace }}" \
--workdir "${{ github.workspace }}" \
ghcr.io/${{ github.repository_owner }}/csound-ioscross:${{ env.VERSION }} \
/bin/sh -lc '
$(eval /ioscross/arm64/ioscross_conf.sh)
cmake --build build/arm64 --config Release
'
macos_build_brew:
name: MacOS build (brew)
runs-on: macos-latest
steps:
- name: Checkout source code
uses: actions/checkout@v5
with:
fetch-depth: 1
submodules: true
- name: Install dependencies
run: |
brew install libogg flac lame libvorbis mpg123 opus libsndfile portaudio libsamplerate liblo portmidi
brew install bison flex jack googletest
- name: Configure build
run: cmake -B build -DCUSTOM_CMAKE="./platform/osx/custom-osx.cmake"
- name: Build Csound
run: cmake --build build --config Debug
- name: Run unit tests
run: cmake --build build --target csdtests test
bare_arm_brew:
name: ARM baremetal build (brew)
runs-on: macos-latest
needs: update_version
env:
CSOUND_VERSION: ${{ needs.update_version.outputs.version }}
steps:
- name: Checkout source code
uses: actions/checkout@v5
with:
fetch-depth: 1
submodules: true
- name: Install dependencies
run: |
brew update
brew install --cask gcc-arm-embedded
brew install bison flex
- name: Configure build
run: cmake -B build -DCMAKE_INSTALL_PREFIX="$PWD/Daisy" -DCUSTOM_CMAKE="$PWD/Daisy/Custom.cmake" -DCMAKE_TOOLCHAIN_FILE="$PWD/Daisy/crosscompile.cmake"
- name: Build Csound
run: cmake --build build --config Release
- name: Install
run: |
cmake --build build --target install
mkdir arm-cortex-m7
cp -r Daisy/DaisyCsoundExamples arm-cortex-m7
cp -r Daisy/lib arm-cortex-m7
cp -r Daisy/include arm-cortex-m7
- name: Upload zip
uses: actions/upload-artifact@v4
with:
name: csound-${{env.CSOUND_VERSION}}-${{github.run_number}}-arm-cortex-m7
path: arm-cortex-m7
macos_build_installer:
name: MacOS build (installer)
runs-on: macos-latest
needs: update_version
env:
CSOUND_VERSION: ${{ needs.update_version.outputs.version }}
steps:
- name: Checkout source code
uses: actions/checkout@v5
with:
fetch-depth: 1
submodules: true
- name: Checkout and build libsndfile, portmidi, portaudio, libsamplerate and liblo
run: |
cd platform/osx
chmod +x build_libsndfile.sh
./build_libsndfile.sh
cd ../..
git clone https://github.com/PortMidi/portmidi.git
cd portmidi
cmake -B build -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -DCMAKE_INSTALL_PREFIX=../portmidi_install
cmake --build build
cmake --build build --target install
cd ..
git clone https://github.com/PortAudio/portaudio.git
cd portaudio
cmake -B build -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -DCMAKE_INSTALL_PREFIX=../portaudio_install
cmake --build build
cmake --build build --target install
cd ..
git clone https://github.com/libsndfile/libsamplerate
cd libsamplerate
cmake -B build -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -DCMAKE_INSTALL_PREFIX=../samplerate_install
cmake --build build
cmake --build build --target install
cd ..
git clone https://github.com/radarsat1/liblo
cd liblo
cmake ./cmake -B build -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -DCMAKE_INSTALL_PREFIX=../liblo_install
cmake --build build
cmake --build build --target install
cd ..
- name: Brew install bison and flex
run: brew install bison flex
- name: Configure Csound
run: |
cmake -B build -DCMAKE_BUILD_TYPE="Release" -DUSE_GETTEXT=0 -DCMAKE_PREFIX_PATH="$PWD/platform/osx/libsndfile_build/dependencies;$PWD/portmidi_install;$PWD/portaudio_install;$PWD/samplerate_install;$PWD/liblo_install" -DCMAKE_INSTALL_PREFIX="$PWD/csound_install" -DCS_FRAMEWORK_DEST="$PWD/csound_install" -DCS_OPCODE_DIR="/Applications/Csound/CsoundLib64.framework/Resources/Opcodes64/" -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -DUSE_MP3=1 -DCMAKE_VERBOSE_MAKEFILE=1 -DUSE_STATIC_DEPS=1 -DBUILD_SRC_CONV=0 -DBUILD_OSC_OPCODES=1 -DALIGN_MEMORY=1
- name: Build Csound
run: |
cmake --build build --config Release
cmake --build build --target install
- name: Adjust ctcsound library load path
run: sed -i -e 's$ctypes.util.find_library("CsoundLib64")$"/Applications/Csound/Csound64.framework/CsoundLib64"$g' Python/ctcsound.py
- name: Adjust link paths in libraries
run: |
install_name_tool -id /Applications/Csound/CsoundLib64.framework/CsoundLib64 csound_install/CsoundLib64.framework/CsoundLib64
install_name_tool -delete_rpath /Users/runner/work/csound/csound/csound_install csound_install/CsoundLib64.framework/CsoundLib64
install_name_tool -change @rpath/CsoundLib64.framework/Versions/7.0/CsoundLib64 /Applications/Csound/CsoundLib64.framework/Versions/7.0/CsoundLib64 csound_install/bin/csound
install_name_tool -change @rpath/libportmidi.2.dylib @loader_path/../../../../libs/libportmidi.dylib csound_install/CsoundLib64.framework/Versions/7.0/Resources/Opcodes64/libpmidi.dylib
install_name_tool -add_rpath /Applications/Csound/CsoundLib64.framework/libs portmidi_install/lib/libportmidi.dylib
install_name_tool -change @rpath/libportaudio.2.dylib @loader_path/../../../../libs/libportaudio.dylib csound_install/CsoundLib64.framework/Versions/7.0/Resources/Opcodes64/librtpa.dylib
install_name_tool -add_rpath /Applications/Csound/CsoundLib64.framework/libs portaudio_install/lib/libportaudio.dylib
install_name_tool -change @rpath/liblo.7.dylib @loader_path/../../../../libs/liblo.dylib csound_install/CsoundLib64.framework/Versions/7.0/Resources/Opcodes64/libosc.dylib
install_name_tool -add_rpath /Applications/Csound/CsoundLib64.framework/libs liblo_install/lib/liblo.dylib
- name: Build installer
run: |
mkdir csound_install/CsoundLib64.framework/Versions/7.0/Resources/Python
cp Python/ctcsound.py csound_install/CsoundLib64.framework/Versions/7.0/Resources/Python
mkdir csound_install/CsoundLib64.framework/libs
cp portmidi_install/lib/*.dylib csound_install/CsoundLib64.framework/libs
cp portaudio_install/lib/*.dylib csound_install/CsoundLib64.framework/libs
cp liblo_install/lib/*.dylib csound_install/CsoundLib64.framework/libs
mkdir -p csound_install/CsoundLib64.framework/Versions/7.0/Resources/cmake
cp csound_install/share/csound/CsoundConfig.cmake csound_install/CsoundLib64.framework/Versions/7.0/Resources/cmake/
cp csound_install/share/csound/CsoundConfigVersion.cmake csound_install/CsoundLib64.framework/Versions/7.0/Resources/cmake/
cp csound_install/share/csound/FindCsound.cmake csound_install/CsoundLib64.framework/Versions/7.0/Resources/cmake/
mkdir -p csound_install/PkgContents/Applications/Csound
mv csound_install/bin/csound csound_install/PkgContents/Applications/Csound/.
mv csound_install/CsoundLib64.framework csound_install/PkgContents/Applications/Csound/.
pkgbuild --identifier com.csound.csound7Environment.csoundLib64 --root csound_install/PkgContents CsoundLib64-${{env.CSOUND_VERSION}}-beta-universal.pkg
- name: Upload zip
uses: actions/upload-artifact@v4
with:
name: csound-${{env.CSOUND_VERSION}}-${{github.run_number}}-macosx-beta
path: ./CsoundLib64-${{env.CSOUND_VERSION}}-beta-universal.pkg
macos_build_vcpkg:
name: MacOS build (vcpkg)
runs-on: macos-latest
if: false
steps:
- name: Checkout source code
uses: actions/checkout@v5
with:
fetch-depth: 1
submodules: true
- uses: lukka/get-cmake@v3.29.0
- name: Export GitHub Actions cache environment variables
uses: actions/github-script@v6
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Bootstrap VCPKG
run: ./vcpkg/bootstrap-vcpkg.sh
- name: Install dependencies
run: brew install bison flex
- name: Configure build
run: cmake -B build -S . -DUSE_DOUBLE=0 -DBUILD_TESTS=1 -DUSE_VCPKG=1 -DCUSTOM_CMAKE="./platform/osx/custom-osx.cmake"
- name: Build Csound
run: cmake --build build --config Release
- name: Run integration and unit tests
run: cmake --build build --target test csdtests
macos_build_vcpkg_arm64:
name: MacOS build (vcpkg arm64)
runs-on: macos-latest
if: false
steps:
- name: Checkout source code
uses: actions/checkout@v5
with:
fetch-depth: 1
submodules: true
- uses: lukka/get-cmake@v3.29.0
- name: Export GitHub Actions cache environment variables
uses: actions/github-script@v6
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Bootstrap VCPKG
run: ./vcpkg/bootstrap-vcpkg.sh
- name: Install dependencies
run: brew install bison flex
- name: Configure build
run: cmake -B build -S . -DBUILD_TESTS=1 -DUSE_VCPKG=1 -DCUSTOM_CMAKE="./platform/osx/custom-osx.cmake"
- name: Build Csound
run: cmake --build build --config Release
- name: Run integration and unit tests
run: cmake --build build --target test csdtests
macos_build_osxcross:
name: MacOS build ( 10BC0 osxcross/vcpkg)
#if: github.ref == 'refs/heads/develop' || vars.ENABLE_CROSS_COMPILERS == 'true'
runs-on: ubuntu-latest
env:
VERSION: v1
steps:
- name: Checkout source code
uses: actions/checkout@v5
with:
fetch-depth: 1
submodules: true
- uses: lukka/get-cmake@v3.29.0
- name: Export GitHub Actions cache environment variables
uses: actions/github-script@v6
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Bootstrap VCPKG
run: ./vcpkg/bootstrap-vcpkg.sh
- name: Log in to GHCR
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin
- name: Configure Build
run: |
docker run --rm \
-v "${{ github.workspace }}:${{ github.workspace }}" \
--workdir "${{ github.workspace }}" \
ghcr.io/${{ github.repository_owner }}/csound-osxcross:${{ env.VERSION }} \
/bin/sh -lc '
$(eval /osxcross/tools/osxcross_conf.sh)
for ARCH in x86_64 arm64; do
cmake -B build/$ARCH -S . -DUSE_VCPKG=1 -DCUSTOM_CMAKE=./platform/osxcross/custom-osx.cmake \
-DCMAKE_SYSTEM_NAME=Darwin \
-DOSXCROSS_TARGET_DIR=${OSXCROSS_TARGET_DIR} \
-DOSXCROSS_SDK=${OSXCROSS_SDK} \
-DOSXCROSS_TARGET=${OSXCROSS_TARGET} \
-DCMAKE_OSX_ARCHITECTURES=${ARCH}
done
'
- name: Build Csound
run: |
docker run --rm \
-v "${{ github.workspace }}:${{ github.workspace }}" \
--workdir "${{ github.workspace }}" \
ghcr.io/${{ github.repository_owner }}/csound-osxcross:${{ env.VERSION }} \
/bin/sh -lc '
$(eval /osxcross/tools/osxcross_conf.sh)
for ARCH in x86_64 arm64; do
cmake --build build/$ARCH --config Release
done
'
windows_build:
name: Windows build (vcpkg)
runs-on: windows-latest
needs: update_version
env:
CSOUND_VERSION: ${{ needs.update_version.outputs.version }}
steps:
- name: Checkout Source Code
uses: actions/checkout@v5
with:
fetch-depth: 1
submodules: true
- uses: lukka/get-cmake@v3.29.0
- name: Export GitHub Actions cache environment variables
uses: actions/github-script@v6
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Install system dependencies
run: |
choco install -y winflexbison3 innosetup
- name: Bootstrap VCPKG
run: .\vcpkg\bootstrap-vcpkg.bat
- name: Configure build
run: cmake -B build -S . -DBUILD_TESTS=1 -DUSE_VCPKG=1 -DCUSTOM_CMAKE="./platform/windows/Custom-vs.cmake"
- name: Build Csound
run: cmake --build build --config Release
- name: Run tests
run: cmake --build build --target csdtests
- name: Run unit test framework
run: cmake --build build --target RUN_TESTS --config Release
- name: Install Csound (for cmake package files)
run: cmake --install build --prefix build\install --config Release
- name: Build installer
# if: github.ref == 'refs/heads/develop'
shell: powershell
run: |
$Env:RedistVersion=Get-Content "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\Microsoft.VCRedistVersion.default.txt"
$Env:VCREDIST_CRT_DIR="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Redist\MSVC\${Env:RedistVersion}\x64\Microsoft.VC143.CRT"
$Env:VCREDIST_CXXAMP_DIR="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Redist\MSVC\${Env:RedistVersion}\x64\Microsoft.VC143.CXXAMP"
$Env:VCREDIST_OPENMP_DIR="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Redist\MSVC\${Env:RedistVersion}\x64\Microsoft.VC143.OpenMP"
iscc /o. installer\\windows\\csound7_x64_github.iss
- name: Upload installer
# if: github.ref == 'refs/heads/develop'
uses: actions/upload-artifact@v4
with:
name: Csound_x64-${{env.CSOUND_VERSION}}.${{github.run_number}}-windows-installer
path: ./Csound7-windows_x86_64-*.exe
if-no-files-found: error
- name: Upload zip
# if: github.ref == 'refs/heads/develop'
uses: actions/upload-artifact@v4
with:
name: Csound_x64-${{env.CSOUND_VERSION}}-${{github.run_number}}-windows-binaries
path: |
./build/Release/*.exe
./build/Release/*.dll
./build/Release/*.pyd
./build/Release/csound64.lib
./build/*.jar
./build/*.py
./include/
if-no-files-found: error
windows_build_i386:
name: Windows 32-bit build (vcpkg)
runs-on: windows-latest
needs: update_version
env:
CSOUND_VERSION: ${{ needs.update_version.outputs.version }}
steps:
- name: Checkout Source Code
uses: actions/checkout@v5
with:
fetch-depth: 1
submodules: true
- uses: lukka/get-cmake@v3.29.0
- name: Export GitHub Actions cache environment variables
uses: actions/github-script@v6
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Install system dependencies
run: |
choco install -y winflexbison3 innosetup
- name: Bootstrap VCPKG
run: .\vcpkg\bootstrap-vcpkg.bat
- name: Configure build
run: cmake -B build -S . -A Win32 -DBUILD_TESTS=1 -DUSE_VCPKG=1 -DCUSTOM_CMAKE="./platform/windows/Custom-vs-x86.cmake"
- name: Build Csound
run: cmake --build build --config Release
- name: Run tests
run: cmake --build build --target csdtests
- name: Run unit test framework
run: cmake --build build --target RUN_TESTS --config Release
- name: Install Csound (for cmake package files)
run: cmake --install build --prefix build\install --config Release
- name: Build installer
# if: github.ref == 'refs/heads/develop'
shell: powershell
run: |
$Env:RedistVersion=Get-Content "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\Microsoft.VCRedistVersion.default.txt"
$Env:VCREDIST_CRT_DIR="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Redist\MSVC\${Env:RedistVersion}\x86\Microsoft.VC143.CRT"
$Env:VCREDIST_CXXAMP_DIR="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Redist\MSVC\${Env:RedistVersion}\x86\Microsoft.VC143.CXXAMP"
$Env:VCREDIST_OPENMP_DIR="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Redist\MSVC\${Env:RedistVersion}\x86\Microsoft.VC143.OpenMP"
iscc /o. installer\\windows\\csound7_x86_github.iss
- name: Upload installer
# if: github.ref == 'refs/heads/develop'
uses: actions/upload-artifact@v4
with:
name: Csound_i386-${{env.CSOUND_VERSION}}.${{github.run_number}}-windows-installer
path: ./Csound7-windows_x86-*.exe
if-no-files-found: error
- name: Upload zip
# if: github.ref == 'refs/heads/develop'
uses: actions/upload-artifact@v4
with:
name: Csound_i386-${{env.CSOUND_VERSION}}-${{github.run_number}}-windows-i386-binaries
path: |
./build/Release/*.exe
./build/Release/*.dll
./build/Release/*.pyd
./build/Release/csound.lib
./build/*.jar
./build/*.py
./include/
if-no-files-found: error
windows_build_mingw:
name: Windows build (mingw/vcpkg)
#if: github.ref == 'refs/heads/develop' || vars.ENABLE_CROSS_COMPILERS == 'true'
runs-on: ubuntu-22.04
steps:
- name: Checkout source code
uses: actions/checkout@v5
with:
fetch-depth: 1
submodules: true
- uses: lukka/get-cmake@v3.29.0
- name: Export GitHub Actions cache environment variables
uses: actions/github-script@v6
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Bootstrap VCPKG
run: ./vcpkg/bootstrap-vcpkg.sh
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install mingw-w64-x86-64-dev gcc-mingw-w64 g++-mingw-w64 mingw-w64-tools wine
- name: Use posix mingw
run: |
sudo update-alternatives --set x86_64-w64-mingw32-gcc /usr/bin/x86_64-w64-mingw32-gcc-posix
sudo update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix
- name: Configure Build
run: cmake -B build -S . -DBUILD_TESTS=1 -DUSE_VCPKG=1 -DCUSTOM_CMAKE="./platform/mingw64-linux/Custom.cmake" -DCMAKE_SYSTEM_NAME=MinGW
- name: Build Csound
run: cmake --build build --config Release
# - name: Run integration and unit tests
# run: cmake --build build --target test csdtests
windows_build_32bit:
name: Windows 32-bit build (mingw/vcpkg)
runs-on: ubuntu-22.04
needs: update_version
env:
CSOUND_VERSION: ${{ needs.update_version.outputs.version }}
steps:
- name: Checkout source code
uses: actions/checkout@v5
with:
fetch-depth: 1
submodules: true
- uses: lukka/get-cmake@v3.29.0
- name: Export GitHub Actions cache environment variables
uses: actions/github-script@v6
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Bootstrap VCPKG
run: ./vcpkg/bootstrap-vcpkg.sh
- name: Use custom vcpkg manifest for 32-bit (without libsndfile)
run: cp vcpkg-x86.json vcpkg.json
- name: Download libsndfile pre-built binaries for Win32
run: |
wget https://github.com/libsndfile/libsndfile/releases/download/1.2.2/libsndfile-1.2.2-win32.zip
unzip libsndfile-1.2.2-win32.zip -d libsndfile-win32
mkdir -p $HOME/libsndfile-i686
cp -r libsndfile-win32/libsndfile-1.2.2-win32/bin $HOME/libsndfile-i686/
cp -r libsndfile-win32/libsndfile-1.2.2-win32/lib $HOME/libsndfile-i686/
cp -r libsndfile-win32/libsndfile-1.2.2-win32/include $HOME/libsndfile-i686/
cp -r libsndfile-win32/libsndfile-1.2.2-win32/cmake $HOME/libsndfile-i686/
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install mingw-w64-i686-dev gcc-mingw-w64-i686 g++-mingw-w64-i686 mingw-w64-tools
- name: Use posix mingw for 32-bit
run: |
sudo update-alternatives --set i686-w64-mingw32-gcc /usr/bin/i686-w64-mingw32-gcc-posix
sudo update-alternatives --set i686-w64-mingw32-g++ /usr/bin/i686-w64-mingw32-g++-posix
- name: Configure Build
run: cmake -B build -S . -DUSE_VCPKG=1 -DUSE_DOUBLE=0 -DUSE_MP3=0 -DCUSTOM_CMAKE="./platform/mingw64-linux/Custom-mingw64-i686.cmake" -DCMAKE_SYSTEM_NAME=MinGW -DCMAKE_C_COMPILER=/usr/bin/i686-w64-mingw32-gcc -DCMAKE_CXX_COMPILER=/usr/bin/i686-w64-mingw32-g++ -DCMAKE_PREFIX_PATH=$HOME/libsndfile-i686/cmake
- name: Build Csound
run: cmake --build build --config Release
- name: Copy libsndfile DLLs to build directory
run: cp $HOME/libsndfile-i686/bin/*.dll ./build/
- name: Upload zip
# if: github.ref == 'refs/heads/develop'
uses: actions/upload-artifact@v4
with:
name: Csound_i386-${{env.CSOUND_VERSION}}-${{github.run_number}}-windows-mingw-binaries
path: |
./build/*.exe
./build/*.dll
./build/*.pyd
./build/*.lib
./build/*.jar
./build/*.py
./include/
if-no-files-found: warn
android_build_vcpkg:
name: Android build (vcpkg)
runs-on: ubuntu-latest
env:
VERSION: v1
steps:
- name: Checkout source code
uses: actions/checkout@v5
with:
fetch-depth: 1
submodules: true
- uses: lukka/get-cmake@v3.29.0
- name: Export GitHub Actions cache environment variables
uses: actions/github-script@v6
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Bootstrap VCPKG
run: ./vcpkg/bootstrap-vcpkg.sh
- name: Log in to GHCR
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin
- name: Configure Build
run: |
docker run --rm \
-v "${{ github.workspace }}:${{ github.workspace }}" \
--workdir "${{ github.workspace }}" \
ghcr.io/${{ github.repository_owner }}/csound-android:${{ env.VERSION }} \
/bin/sh -lc '
for ARCH in arm arm64 x86 x64; do
cmake -B build/$ARCH -S . -DUSE_VCPKG=1 -DCUSTOM_CMAKE=./platform/android/custom-android.cmake \
-DCMAKE_SYSTEM_NAME=Android \
-DANDROID=1 \
-DCMAKE_TARGET_ARCHITECTURE=${ARCH}
done
'
- name: Build Csound
run: |
docker run --rm \
-v "${{ github.workspace }}:${{ github.workspace }}" \
--workdir "${{ github.workspace }}" \
ghcr.io/${{ github.repository_owner }}/csound-android:${{ env.VERSION }} \
/bin/sh -lc '
for ARCH in arm arm64 x86 x64; do
cmake --build build/$ARCH --config Release
done
'
wasm_build:
name: Wasm build (emscripten/vcpkg)
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v5
with:
fetch-depth: 1
submodules: true
- name: Export GitHub Actions cache environment variables
uses: actions/github-script@v6
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Bootstrap VCPKG
run: ./vcpkg/bootstrap-vcpkg.sh
- name: Set up Emscripten
uses: mymindstorm/setup-emsdk@v14
with:
version: 3.1.64
actions-cache-folder: emsdk-cache
- name: Configure Build
run: |
cmake -B build -S . -DUSE_VCPKG=1 -DCUSTOM_CMAKE="./platform/wasm/Custom-wasm.cmake" -DCMAKE_SYSTEM_NAME=Emscripten -DEMSDK=$EMSDK -DEMSDK_NODE=$EMSDK_NODE
- name: Build Csound
run: cmake --build build --config Release
#- name: Run integration and unit tests
# run: cmake --build build --target test csdtests
android-release:
name: Csound for Android
runs-on: macos-latest
needs: update_version
env:
CSOUND_VERSION: ${{ needs.update_version.outputs.version }}
steps:
- name: Install dependencies
run: brew install swig bison flex
- name: Checkout Source Code
uses: actions/checkout@v5
with:
fetch-depth: 1
- name: Download NDK
working-directory: Android
run: sh downloadNDK.sh
- name: Download Dependencies
working-directory: Android
run: |
export NDK_MODULE_PATH=$PWD/modules
sh downloadDependencies.sh
- name: build CsoundAndroid
working-directory: Android
run: |
export PATH="/opt/homebrew/opt/bison/bin:$PATH"
export NDK_MODULE_PATH=$PWD/modules
export ANDROID_NDK_ROOT="$PWD/AndroidNDK.app/Contents/NDK"
cd CsoundAndroid
sh build.sh
- name: create release package
working-directory: Android
run: |
sh update.sh
sh release.sh
- uses: actions/upload-artifact@v4
#if: github.ref == 'refs/heads/develop'
with:
name: CsoundForAndroid-${{env.CSOUND_VERSION}}
path: Android/csound-android-${{env.CSOUND_VERSION}}
publish_artifacts:
#
if: ${{ github.ref == 'refs/heads/develop' && needs.update_version.outputs.release == 'true' }}
name: Publish Artifacts
runs-on: ubuntu-latest
needs:
[
update_version,
windows_build,
windows_build_i386,
macos_build_installer,
iOS_build,
android-release,
bare_arm_brew,
]
env:
CSOUND_VERSION: ${{ needs.update_version.outputs.version }}
steps:
- name: Download Windows installer
uses: actions/download-artifact@v4
with:
name: Csound_x64-${{env.CSOUND_VERSION}}.${{github.run_number}}-windows-installer
path: csound-windows-${{env.CSOUND_VERSION}}
- name: Download Windows binaries
uses: actions/download-artifact@v4
with:
name: Csound_x64-${{env.CSOUND_VERSION}}-${{github.run_number}}-windows-binaries
path: csound-windows-i386-${{env.CSOUND_VERSION}}
- name: Download Windows 32-bit installer
uses: actions/download-artifact@v4
with:
name: Csound_i386-${{env.CSOUND_VERSION}}.${{github.run_number}}-windows-installer
path: csound-windows-i386-installer-${{env.CSOUND_VERSION}}
- name: Download Windows 32-bit binaries
uses: actions/download-artifact@v4
with:
name: Csound_i386-${{env.CSOUND_VERSION}}-${{github.run_number}}-windows-i386-binaries
path: csound-windows-i386-${{env.CSOUND_VERSION}}
- name: Download macOS installer
uses: actions/download-artifact@v4
with:
name: csound-${{env.CSOUND_VERSION}}-${{github.run_number}}-macosx-beta
path: csound-macos-${{env.CSOUND_VERSION}}
- name: Download arm-cortex-m7 package
uses: actions/download-artifact@v4
with:
name: csound-${{env.CSOUND_VERSION}}-${{github.run_number}}-arm-cortex-m7
path: csound-arm-cortex-m7-${{env.CSOUND_VERSION}}
- name: Download iOS artifacts
uses: actions/download-artifact@v4
with:
name: Csound-For-iOS-${{env.CSOUND_VERSION}}
path: csound-ios-${{env.CSOUND_VERSION}}
- name: Download Android artifacts
uses: actions/download-artifact@v4
with:
name: CsoundForAndroid-${{env.CSOUND_VERSION}}
path: csound-android-${{env.CSOUND_VERSION}}
- name: Zip release directories
run: |
zip -r csound-windows-${{env.CSOUND_VERSION}}.zip csound-windows-${{env.CSOUND_VERSION}}
zip -r csound-windows-i386-installer-${{env.CSOUND_VERSION}}.zip csound-windows-i386-installer-${{env.CSOUND_VERSION}}
zip -r csound-macos-${{env.CSOUND_VERSION}}.zip csound-macos-${{env.CSOUND_VERSION}}
zip -r csound-ios-${{env.CSOUND_VERSION}}.zip csound-ios-${{env.CSOUND_VERSION}}
zip -r csound-android-${{env.CSOUND_VERSION}}.zip csound-android-${{env.CSOUND_VERSION}}
zip -r csound-arm-cortex-m7-${{env.CSOUND_VERSION}}.zip csound-arm-cortex-m7-${{env.CSOUND_VERSION}}
- name: List release artifacts
run: ls -l
- name: Create Release
uses: softprops/action-gh-release@v2
with:
token: ${{ secrets.SERVICE_ACCOUNT_PAT }}
tag_name: ${{ env.CSOUND_VERSION }}
generate_release_notes: true
make_latest: true
files: |
csound-windows-${{env.CSOUND_VERSION}}.zip
csound-windows-i386-installer-${{env.CSOUND_VERSION}}.zip
csound-macos-${{env.CSOUND_VERSION}}.zip
csound-ios-${{env.CSOUND_VERSION}}.zip
csound-android-${{env.CSOUND_VERSION}}.zip
csound-arm-cortex-m7-${{env.CSOUND_VERSION}}.zip
0