-
-
Notifications
You must be signed in to change notification settings - Fork 1
222 lines (222 loc) · 6.87 KB
/
Release.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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
---
name: Release
on:
workflow_dispatch:
push:
tags: '*'
permissions:
contents: write
env:
LIBNAME: pd4web
LIBVERSION: ${{ github.ref_name }}
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.x
- uses: actions/cache@v4
with:
key: ${{ github.ref }}
path: .cache
- run: pip install -r Documentation/requirements.txt
- run: mkdocs gh-deploy --force
tests:
strategy:
fail-fast: false
matrix:
python-version: ['3.11']
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
timeout-minutes: 45
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install linux requirements
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt update
sudo apt install -y wget
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo apt install -y ./google-chrome-stable_current_amd64.deb
sudo apt-get install chromium-chromedriver
pip install selenium flask
- name: Install pd4web
run: |
pip install .
- name: Tests
run: |-
python3 ./Tests/Tests.py
publish:
runs-on: ubuntu-latest
needs: tests
strategy:
matrix:
python-version: ['3.11'] # just need one version (py3-none)
timeout-minutes: 30
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install pd4web
run: |
pip install poetry
poetry build
pip install dist/*.whl
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
continue-on-error: true
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
# PureData Object
macos-x86-build:
runs-on: macos-13
strategy:
matrix:
precision: [32, 64]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Build Object for x86
run: |
brew install --cask pd
cd Resources/Pd
export CPLUS_INCLUDE_PATH="$CPLUS_INCLUDE_PATH:/usr/local/include/"
export LDFLAGS="-L/usr/local/lib"
cmake . -B build -DPD_FLOATSIZE=${{ matrix.precision }} -DPDLIBDIR=./ -DCMAKE_BUILD_TYPE=Release
cmake --build build -j $(sysctl -n hw.logicalcpu)
cmake --install build --config Release
- name: Upload Object
uses: actions/upload-artifact@v4
with:
name: ${{env.LIBNAME}}-macos-x86-${{matrix.precision}}
path: Resources/Pd/pd4web
macos-arm-build:
runs-on: macos-latest
strategy:
matrix:
precision: [32, 64]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Build Object
run: |
brew install --cask pd
cd Resources/Pd
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 }} -DPDLIBDIR=./ -DCMAKE_BUILD_TYPE=Release
cmake --build build -j $(sysctl -n hw.logicalcpu) --config Release
cmake --install build
- name: Upload Object
uses: actions/upload-artifact@v4
with:
name: ${{env.LIBNAME}}-macos-arm-${{matrix.precision}}
path: Resources/Pd/pd4web
linux-build:
runs-on: ubuntu-latest
strategy:
matrix:
arch: [amd64]
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
- name: Build Object
run: |
cd Resources/Pd
cmake . -B build -DPD_FLOATSIZE=${{ matrix.precision }} -DPDLIBDIR=./ -DCMAKE_BUILD_TYPE=Release
cmake --build build -j$(nproc) --config Release
cmake --install build
- name: Upload Object
uses: actions/upload-artifact@v4
with:
name: ${{ env.LIBNAME }}-linux-${{matrix.arch}}-${{matrix.precision}}
path: Resources/Pd/pd4web
windows-build:
runs-on: windows-latest
strategy:
matrix:
arch: [amd64]
precision: [32]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: PureData Sources
run: |
choco install puredata
- name: Build Object
run: |
cd Resources/Pd
cmake . -B build -DPD_FLOATSIZE=${{ matrix.precision }} -DPDLIBDIR="./"
cmake --build build --config Release
cmake --install build
- name: Upload Object
uses: actions/upload-artifact@v4
with:
name: ${{ env.LIBNAME }}-windows-${{matrix.arch}}-${{matrix.precision}}
path: Resources/Pd/pd4web
package-artifacts:
needs:
- macos-arm-build
- macos-x86-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: Install Deken
continue-on-error: true
run: |
mkdir -p ${PWD}/package
docker run --rm --user $(id -u) \
--volume ${PWD}/artifacts:/${{ env.LIBNAME }} \
--volume ${PWD}/package:/package \
registry.git.iem.at/pd/deken \
deken package /${{ env.LIBNAME}} --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/