-
Notifications
You must be signed in to change notification settings - Fork 0
217 lines (182 loc) · 6.8 KB
/
compile-and-artifacts.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
name: Build and upload artifacts
env:
PD_VERSION: 0.55-0
LIBNAME: quatkram
on:
push:
branches: [ main, build-tests ]
tags: [ '*' ]
pull_request:
branches: [ main ]
jobs:
ubuntu-build:
runs-on: ubuntu-latest
strategy:
matrix:
floatsize: [32, 64]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: install dependencies
run: |
git clone --branch=${{ env.PD_VERSION }} --depth=1 https://github.com/pure-data/pure-data.git
- name: make
run: make install objectsdir=./build PDDIR=./pure-data floatsize=${{ matrix.floatsize }} extension=linux-amd64-${{ matrix.floatsize }}.so
- name: upload
uses: actions/upload-artifact@v4
with:
name: ${{ env.LIBNAME }}-ubuntu-pd${{ matrix.floatsize }}
path: build
macos-build:
runs-on: macos-latest
strategy:
matrix:
floatsize: [32, 64]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: install dependencies
run: |
wget https://github.com/pure-data/pure-data/archive/refs/tags/${{ env.PD_VERSION }}.zip
unzip ${{ env.PD_VERSION }}.zip
- name: make
run: make install objectsdir=./build PDDIR=./pure-data-${{ env.PD_VERSION }} arch="arm64 x86_64" floatsize=${{ matrix.floatsize }} extension=darwin-fat-${{ matrix.floatsize }}.so
- name: upload
uses: actions/upload-artifact@v4
with:
name: ${{ env.LIBNAME }}-macos-pd${{ matrix.floatsize }}
path: build
windows-build:
runs-on: windows-latest
strategy:
matrix:
floatsize: [32, 64]
env:
CC: gcc
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: install dependencies for 32-bit
if: matrix.floatsize == 32
run: |
C:\msys64\usr\bin\wget.exe http://msp.ucsd.edu/Software/pd-${{ env.PD_VERSION }}.msw.zip
unzip pd-${{ env.PD_VERSION }}.msw.zip
- name: install dependencies for 64-bit
if: matrix.floatsize == 64
run: | # unfortunately, the folder name convention is slightly different here
C:\msys64\usr\bin\wget.exe https://puredata.info/downloads/pure-data/releases/${{ env.PD_VERSION }}-pd64/Pd64-${{ env.PD_VERSION }}.msw.zip
unzip Pd64-${{ env.PD_VERSION }}.msw.zip
Get-ChildItem -Directory -Filter 'Pd-0.*' | ForEach-Object {
Rename-Item $_.FullName "pd-${{ env.PD_VERSION }}"
}
- name: make 32-bit
run: make install objectsdir=./build PDDIR=./pd-${{ env.PD_VERSION }} PDINCLUDEDIR=./pd-${{ env.PD_VERSION }}/src PDBINDIR=./pd-${{ env.PD_VERSION }}/bin floatsize=${{ matrix.floatsize }} extension=windows-amd64-${{ matrix.floatsize }}.dll
- name: upload
uses: actions/upload-artifact@v4
with:
name: ${{ env.LIBNAME }}-windows-pd${{ matrix.floatsize }}
path: build
github-release:
if: github.ref_type == 'tag'
runs-on: ubuntu-latest
needs: [ubuntu-build, macos-build, windows-build]
steps:
- uses: actions/download-artifact@v4
- name: ziptie
run: |
mkdir dist
for x in ${{ env.LIBNAME }}-*; do (cd $x && zip -r ../dist/$x.zip ${{ env.LIBNAME }}/); done
- name: release
uses: softprops/action-gh-release@v2
with:
prerelease: true
draft: true
files: dist/*.zip
merge-for-deken:
runs-on: ubuntu-latest
needs: [github-release]
permissions:
contents: write
actions: read
strategy:
matrix:
os: [windows, macos, ubuntu]
steps:
- name: download artifacts # FIXME: currently downloads all artifacts redundantly for each OS
uses: actions/download-artifact@v4
with:
path: artifacts
- name: merge artifacts to package
run: cp -rn artifacts/${{ env.LIBNAME }}-${{ matrix.os }}*/* .
- name: upload package
uses: actions/upload-artifact@v4
with:
name: ${{ env.LIBNAME }}-${{ matrix.os }}
path: ${{ env.LIBNAME }}
deken-check:
runs-on: ubuntu-latest
needs: [merge-for-deken]
strategy:
matrix:
os: [windows, macos, ubuntu]
steps:
- uses: actions/download-artifact@v4
with:
name: ${{ env.LIBNAME }}-${{ matrix.os }}
path: ${{ env.LIBNAME }}-${{ matrix.os }}
- name: check deken package
shell: bash
run: |
echo "## ${{ matrix.os }}" | tee -a $GITHUB_STEP_SUMMARY
mkdir -p package-${{ matrix.os }}
docker run --rm --user $(id -u) --volume ./${{ env.LIBNAME }}-${{ matrix.os }}:/${{ env.LIBNAME }} \
--volume ./package-${{ matrix.os }}:/package registry.git.iem.at/pd/deken \
deken package --output-dir /package -v "${{ github.ref_name }}" /${{ env.LIBNAME }}
dek_files=$(ls package-${{ matrix.os }}/*.dek)
for dek_file in $dek_files; do
filename=$(basename "$dek_file")
echo -e "#### \`$filename\`" | tee -a $GITHUB_STEP_SUMMARY
echo '```' | tee -a $GITHUB_STEP_SUMMARY
unzip -l "$dek_file" | awk 'NR>3 {print $4}' | sed '/^$/d' | sort | tee -a $GITHUB_STEP_SUMMARY
echo '```' | tee -a $GITHUB_STEP_SUMMARY
done
deken-upload:
if: ${{ !contains(github.ref, 'test') }} # upload if not a "test" tag (maybe should be more restrictive?)
runs-on: ubuntu-latest
needs: [merge-for-deken]
steps:
- uses: actions/checkout@v4
with:
path: ${{ env.LIBNAME }}-src
- uses: actions/download-artifact@v4
with:
name: ${{ env.LIBNAME }}-windows
path: ${{ env.LIBNAME }}-windows
- uses: actions/download-artifact@v4
with:
name: ${{ env.LIBNAME }}-macos
path: ${{ env.LIBNAME }}-macos
- uses: actions/download-artifact@v4
with:
name: ${{ env.LIBNAME }}-ubuntu
path: ${{ env.LIBNAME }}-ubuntu
- name: upload deken package
shell: bash
env:
DEKEN_USERNAME: ${{ secrets.DEKEN_USERNAME }}
DEKEN_PASSWORD: ${{ secrets.DEKEN_PASSWORD }}
run: |
for os in ubuntu macos windows; do
docker run --rm -e DEKEN_USERNAME -e DEKEN_PASSWORD \
--volume ./${{ env.LIBNAME }}-${os}:/${{ env.LIBNAME }} registry.git.iem.at/pd/deken \
deken upload --no-source-error -v "${{ github.ref_name }}" /${{ env.LIBNAME }}
done
docker run --rm -e DEKEN_USERNAME -e DEKEN_PASSWORD \
--volume ./${{ env.LIBNAME }}-src:/${{ env.LIBNAME }} registry.git.iem.at/pd/deken \
deken upload -v "${{ github.ref_name }}" /${{ env.LIBNAME }}