-
Notifications
You must be signed in to change notification settings - Fork 4
151 lines (151 loc) · 5.6 KB
/
c-cpp.yml
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
name: C/C++ CI
on:
workflow_dispatch:
push:
branches: ["main"]
pull_request:
branches: ["main"]
env:
LIBNAME: simple
jobs:
macos-universal-build:
runs-on: macos-latest
strategy:
matrix:
arch: [amd64, arm64]
precision: [32, 64] # TODO: We need to install PD64?
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Install PureData and Deps
run: |
brew install --cask pd
# Add here dynamic libraries that you use (ex. fftw3, gsl, ...).
# Search for the name in https://brew.sh/
- name: Build Object for Arm
if: ${{ matrix.arch == 'arm64' }}
run: |
cmake . -B build -DCMAKE_OSX_ARCHITECTURES=arm64 -DPD_FLOATSIZE=${{ matrix.precision }}
cmake --build build -j $(sysctl -n hw.logicalcpu)
- name: Build Object for Intel
if: ${{ matrix.arch == 'amd64' }}
run: |
cmake . -B build -DPD_FLOATSIZE=${{ matrix.precision }} -DCMAKE_OSX_ARCHITECTURES=x86_64
cmake --build build -j $(sysctl -n hw.logicalcpu)
- name: Upload Object
uses: actions/upload-artifact@v4
with:
name: ${{env.LIBNAME}}-macos-${{matrix.arch}}-${{matrix.precision}}
path: Binaries
windows-build:
runs-on: windows-latest
strategy:
matrix:
compiler: [mingw, msvc] # CHANGE: Choose between a compiler, you don't need boths
arch: [amd64]
precision: [32, 64]
steps:
- name: Checkout repository
uses: actions/checkout@v4
# ──────────────────────────────────────
- if: matrix.compiler == 'msvc'
name: Set up Visual Studio Build Tools
uses: microsoft/setup-msbuild@v2
# TODO: Add vcpkg support
# ──────────────────────────────────────
- 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
# Add here dynamic libraries that you use (ex. fftw3, gsl, ...).
# Search for the name in https://packages.msys2.org/queue
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
- name: Install PureData Float 64
if: matrix.precision == '64'
run: |
winget install -e --id MillerPuckette.Pd64 --accept-source-agreements
- name: Configure and build
run: |
cmake . -B build -DPD_FLOATSIZE=${{ matrix.precision }}
cmake --build build
- name: Upload
uses: actions/upload-artifact@v4
with:
name: ${{env.LIBNAME}}-f${{ matrix.precision }}-windows-${{ matrix.compiler }}
path: Binaries
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
- name: PureData Sources
run: |
sudo apt update
sudo add-apt-repository ppa:pure-data/pure-data -y
sudo apt install puredata -y
# Add here dynamic libraries that you use (ex. fftw3, gsl, ...).
# search for the name in https://packages.ubuntu.com/search
- name: Install aarch64 gcc
if: matrix.arch == 'aarch64'
run: |
sudo apt install gcc-aarch64-linux-gnu -y
sudo apt install g++-aarch64-linux-gnu -y
- name: Install arm gcc
if: matrix.arch == 'arm'
run: |
sudo apt install gcc-arm-linux-gnueabihf -y
sudo apt install g++-arm-linux-gnueabihf -y
- name: Build Object
if: matrix.arch == 'amd64'
run: |
cmake . -B build -DPD_FLOATSIZE=${{ matrix.precision }}
cmake --build build -- -j$(nproc)
- name: Build Object
if: matrix.arch == 'aarch64'
run: |
cmake . -B build -DPD_FLOATSIZE=${{ matrix.precision }} -DCMAKE_SYSTEM_PROCESSOR=aarch64
cmake --build build -- -j$(nproc)
- name: Build Object
if: matrix.arch == 'arm'
run: |
cmake . -B build -DPD_FLOATSIZE=${{ matrix.precision }} -DCMAKE_SYSTEM_PROCESSOR=arm
cmake --build build -- -j$(nproc)
- name: Upload Object
uses: actions/upload-artifact@v4
with:
name: ${{ env.LIBNAME }}-linux-${{matrix.arch}}-${{matrix.precision}}
path: Binaries
package-artifacts:
needs: [macos-universal-build, 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: Upload artifacts zip
uses: actions/upload-artifact@v4
with:
name: ${{env.LIBNAME}}-ALL-binaries
path: artifacts