Merge branch 'master' of github.com:charlesneimog/py4pd #609
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: C/C++ CI | |
on: | |
workflow_dispatch: | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master] | |
env: | |
LIBNAME: py4pd | |
LIBVERSION: 0.8.7 | |
jobs: | |
macos-x86: | |
runs-on: macos-13 | |
strategy: | |
matrix: | |
precision: [32, 64] # bits must be update on winget first | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
fetch-depth: 0 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
- name: Install PureData and Deps arm64 Mac | |
run: | | |
brew install pd | |
- name: Build Object | |
run: | | |
python3.12 -m pip install numpy --break-system-packages | |
cmake . -B build -DPD_FLOATSIZE=${{ matrix.precision }} -DPYVERSION=3.12 -DPDLIBDIR=./ | |
cmake --build build -j $(sysctl -n hw.logicalcpu) | |
cmake --install build | |
- name: Upload Object | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{env.LIBNAME}}-macos-x86-${{matrix.precision}} | |
path: ${{env.LIBNAME}} | |
macos-arm: | |
runs-on: macos-latest | |
strategy: | |
matrix: | |
arch: [arm64] | |
precision: [32] # 64 bits must be update on winget first | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
fetch-depth: 0 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
- name: Install PureData and Deps arm64 Mac | |
run: | | |
brew install pd | |
- name: Build Object for Arm | |
if: ${{ matrix.arch == 'arm64' }} | |
run: | | |
python3.12 -m pip install numpy --break-system-packages | |
export CPLUS_INCLUDE_PATH="$CPLUS_INCLUDE_PATH:/opt/homebrew/include/" | |
export LDFLAGS="-L/opt/homebrew/lib" | |
cmake . -B build -DCMAKE_OSX_ARCHITECTURES=arm64 -DPD_FLOATSIZE=${{ matrix.precision }} -DPYVERSION=3.12 -DPDLIBDIR=./ | |
cmake --build build -j $(sysctl -n hw.logicalcpu) | |
cmake --install build | |
- name: Upload Object | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{env.LIBNAME}}-macos-${{matrix.arch}}-${{matrix.precision}} | |
path: ${{env.LIBNAME}} | |
windows-build: | |
runs-on: windows-latest | |
strategy: | |
matrix: | |
compiler: [mingw] | |
arch: [amd64] | |
precision: [32] # need to update pd64 on winget | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
fetch-depth: 0 | |
- if: matrix.compiler == 'mingw' | |
name: Set up Msys2 | |
uses: msys2/setup-msys2@v2 | |
with: | |
msystem: mingw64 | |
install: make mingw-w64-x86_64-gcc mingw64/mingw-w64-x86_64-cmake | |
update: false | |
- name: Install winget | |
uses: Cyberboss/install-winget@v1 | |
- name: Install PureData Float 32 | |
if: matrix.precision == '32' | |
run: | | |
winget install -e --id MillerPuckette.PureData --accept-source-agreements | |
winget install --id=Python.Python.3.12 -e | |
py -3.12 -m pip install numpy | |
- name: Install PureData Float 64 | |
if: matrix.precision == '64' | |
run: | | |
winget install -e --id MillerPuckette.Pd64 --accept-source-agreements | |
winget install --id=Python.Python.3.12 -e | |
py -3.12 -m pip install numpy | |
- name: Configure and build Mingw | |
shell: msys2 {0} | |
if: matrix.compiler == 'mingw' | |
run: | | |
cmake . -B build -DPD_FLOATSIZE=${{ matrix.precision }} -DPYVERSION=3.12 -DPDLIBDIR=./ | |
cmake --build build | |
cmake --install build | |
- name: Upload | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{env.LIBNAME}}-f${{ matrix.precision }}-windows-${{ matrix.compiler | |
}} | |
path: ${{env.LIBNAME}} | |
linux-build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
arch: [amd64] # aarch64, arm] | |
precision: [32, 64] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
fetch-depth: 0 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
- name: PureData Sources | |
run: | | |
sudo apt update | |
sudo add-apt-repository ppa:pure-data/pure-data -y | |
sudo apt install puredata -y | |
python3.12 -m pip install numpy | |
- name: Build Object | |
if: matrix.arch == 'amd64' | |
run: | | |
cmake . -B build -DPD_FLOATSIZE=${{ matrix.precision }} -DPYVERSION=3.12 -DPDLIBDIR=./ | |
cmake --build build -- -j$(nproc) | |
cmake --install build | |
- name: Upload Object | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.LIBNAME }}-linux-${{matrix.arch}}-${{matrix.precision}} | |
path: ${{env.LIBNAME}} | |
package-artifacts: | |
needs: [macos-arm, macos-x86, windows-build, linux-build] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
pattern: ${{ env.LIBNAME }}-* | |
path: artifacts | |
merge-multiple: true | |
- name: Clear tmp files | |
run: rm -f artifacts/*.pdb | |
# ────────────────────────────────────── | |
- name: Install Deken | |
continue-on-error: true | |
run: | | |
mkdir -p ${PWD}/package | |
docker run --rm --user $(id -u) \ | |
--volume ${PWD}/artifacts:/artifacts \ | |
--volume ${PWD}/package:/package \ | |
registry.git.iem.at/pd/deken \ | |
deken package /artifacts --output-dir /package -v ${{env.LIBVERSION}} -n ${{env.LIBNAME}} | |
- name: Clear Artifacts | |
uses: geekyeggo/delete-artifact@v5 | |
with: | |
name: ${{ env.LIBNAME }}-* | |
- name: Upload Deken | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.LIBNAME }}-${{env.LIBVERSION}} | |
path: ./package/ |