-
Notifications
You must be signed in to change notification settings - Fork 6
158 lines (158 loc) · 6.53 KB
/
c-cpp.yml
File metadata and controls
158 lines (158 loc) · 6.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
---
name: Compile PureData Object
on:
push:
branches: [main]
#╭──────────────────────────────────────╮
#│ Uncomment if you want to trigger a │
#│ release │
#╰──────────────────────────────────────╯
# workflow_dispatch:
# inputs:
# publish_release:
# description: Publish a GitHub Release using LIBVERSION after build
# required: false
# type: boolean
# default: false
env:
LIBNAME: examples
LIBVERSION: 0.0.0
permissions:
contents: write
jobs:
macos:
runs-on: ${{ matrix.machines }}
strategy:
matrix:
precision: [32, 64]
machines: [macos-latest]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Install PureData and Deps
run: |
brew install pd
- name: Build
run: |
cmake . -B build -DPDLIBDIR=./ -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -DPD_FLOATSIZE=${{ matrix.precision }}
cmake --build build --parallel
- name: Upload Object
uses: actions/upload-artifact@v4
with:
name: ${{env.LIBNAME}}-${{env.LIBVERSION}}-${{matrix.machines}}-universal-pd${{matrix.precision}}
path: ${{env.LIBNAME}}
linux-build:
runs-on: ubuntu-latest
strategy:
matrix:
arch: [amd64, arm, aarch64]
precision: [32, 64]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 1
- name: PureData Sources
run: |
sudo apt-get update
sudo add-apt-repository ppa:pure-data/pure-data -y
sudo apt-get install puredata -y
- name: Install compiler
id: compiler
run: |
arch=""
test "${{ matrix.arch }}" != "aarch64" || arch="aarch64-linux-gnu"
test "${{ matrix.arch }}" != "arm" || arch="arm-linux-gnueabihf"
if test -n "${arch}"; then
sudo apt-get install -y g++-${arch}
echo "arch=${arch}" >> $GITHUB_OUTPUT
fi
- name: Configure
run: |
arch="${{ steps.compiler.outputs.arch }}"
cmake . -B build -DPD_FLOATSIZE=${{ matrix.precision }} -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_PROCESSOR=${{ matrix.arch }} -DPDLIBDIR=./ -DCMAKE_BUILD_TYPE=Release ${arch:+-DCMAKE_C_COMPILER=${arch}-gcc -DCMAKE_CXX_COMPILER=${arch}-g++}
- name: Build Object
run: |
cmake --build build -- -j$(nproc)
- name: Upload Object
uses: actions/upload-artifact@v4
with:
name: ${{env.LIBNAME}}-${{env.LIBVERSION}}-ubuntu-latest-${{matrix.arch}}-pd${{matrix.precision}}
path: ${{env.LIBNAME}}
windows-build:
runs-on: windows-latest
strategy:
matrix:
compiler: [mingw]
arch: [amd64]
precision: [32, 64]
steps:
- name: Checkout repository
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 PureData Float 32
if: matrix.precision == '32'
run: |
winget install -e --id MillerPuckette.PureData --accept-source-agreements
- name: Install PureData Float 64
if: matrix.precision == '64'
run: |
winget install -e --id MillerPuckette.Pd64 --accept-source-agreements
- name: Configure and build Mingw
shell: msys2 {0}
if: matrix.compiler == 'mingw'
run: |
cmake . -B build -DPD_FLOATSIZE=${{ matrix.precision }} -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_SYSTEM_PROCESSOR=${{ matrix.arch }} -DPDLIBDIR=./ -DCMAKE_BUILD_TYPE=Release
cmake --build build --parallel
- name: Upload
uses: actions/upload-artifact@v4
with:
name: ${{env.LIBNAME}}-${{env.LIBVERSION}}-windows-latest-${{matrix.arch}}-pd${{matrix.precision}}
path: ${{env.LIBNAME}}
#╭──────────────────────────────────────╮
#│ Here an example to how publish a │
#│ release, uncomment the input or │
#│ remove the if │
#╰──────────────────────────────────────╯
# publish-release:
# if: ${{ github.event.inputs.publish_release == 'true' }}
# needs: [macos, linux-build, windows-build]
# runs-on: ubuntu-latest
# steps:
# - name: Download all artifacts
# uses: actions/download-artifact@v4
# with:
# path: artifacts
# - name: Create unified onnx directory and archive
# run: |
# set -e
# TOPDIR="$LIBNAME"
# mkdir -p "$TOPDIR"
# for artifact_dir in artifacts/*; do
# [ -d "$artifact_dir" ] || continue
# cp -r "$artifact_dir/"* "$TOPDIR/"
# done
# ls -1 "$TOPDIR"
# ZIP_NAME="${LIBNAME}-${LIBVERSION}-all-platforms.zip"
# zip -r "$ZIP_NAME" "$TOPDIR"
# - name: Create / Update GitHub Release
# uses: softprops/action-gh-release@v2
# with:
# tag_name: v${{ env.LIBVERSION }}
# name: ${{ env.LIBNAME }} v${{ env.LIBVERSION }}
# target_commitish: ${{ github.sha }}
# files: |
# ${{ env.LIBNAME }}-${{ env.LIBVERSION }}-all-platforms.zip
# draft: true
# prerelease: false