Skip to content

Commit b93a1d8

Browse files
authored
Cleanup and rework CI setup (#942)
* rework and cleanup CI setup Signed-off-by: falkTX <falktx@falktx.com> * continue CI cleanup Signed-off-by: falkTX <falktx@falktx.com> * Only use --mixed for win64 Signed-off-by: falkTX <falktx@falktx.com> --------- Signed-off-by: falkTX <falktx@falktx.com>
1 parent 39521b4 commit b93a1d8

File tree

1 file changed

+53
-205
lines changed

1 file changed

+53
-205
lines changed

.github/workflows/build.yml

Lines changed: 53 additions & 205 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,18 @@ on:
88
branches:
99
- '*'
1010
env:
11-
CACHE_VERSION: 6
12-
DEBIAN_FRONTEND: noninteractive
13-
HOMEBREW_NO_AUTO_UPDATE: 1
14-
PAWPAW_VERSION: 86d947d472e1478af882175ee329a6f769b4d15c
11+
CACHE_VERSION: 20230704
12+
PAWPAW_VERSION: 6a3c6a65a89abe221858c3f7635140074506bfc3
1513
PAWPAW_SKIP_LTO: 1
14+
PAWPAW_SKIP_GLIB: 1
15+
PAWPAW_SKIP_LV2: 1
1616

1717
jobs:
18-
# macOS native intel build
1918
macos:
20-
runs-on: macos-10.15
19+
strategy:
20+
matrix:
21+
target: [intel, universal]
22+
runs-on: macos-11
2123
steps:
2224
- uses: actions/checkout@v3
2325
with:
@@ -27,40 +29,45 @@ jobs:
2729
with:
2830
path: |
2931
~/PawPawBuilds
30-
key: macos-v${{ env.CACHE_VERSION }}
32+
key: macos-${{ matrix.target }}-v${{ env.CACHE_VERSION }}
3133
- name: Set up dependencies
3234
run: |
3335
brew install cmake jq meson
34-
- name: Bootstrap macOS intel
36+
- name: Bootstrap dependencies
3537
shell: bash
3638
run: |
3739
if [ ! -d PawPaw ]; then
3840
git clone https://github.com/DISTRHO/PawPaw.git
3941
git -C PawPaw checkout ${PAWPAW_VERSION}
4042
fi
41-
./PawPaw/bootstrap-jack2.sh macos && ./PawPaw/.cleanup.sh macos
43+
./PawPaw/bootstrap-jack2.sh macos-${{ matrix.target }} && ./PawPaw/.cleanup.sh macos-${{ matrix.target }}
4244
- name: Build jack2
4345
shell: bash
4446
run: |
45-
pushd PawPaw && source local.env macos && popd
47+
pushd PawPaw && source local.env macos-${{ matrix.target }} && popd
4648
python ./waf configure --platform=darwin --prefix=/usr/local
4749
python ./waf build -j $(sysctl -n hw.logicalcpu)
4850
python ./waf install --destdir=$(pwd)/destdir
49-
- name: Set sha8
50-
id: slug
51-
run: echo "::set-output name=sha8::$(echo ${{ github.sha }} | cut -c1-8)"
51+
- name: Set sha8 (non-release)
52+
if: startsWith(github.ref, 'refs/tags/') != true
53+
run: echo "SHA8=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV
54+
- name: Set sha8 (release)
55+
if: startsWith(github.ref, 'refs/tags/')
56+
run: echo "SHA8=$(echo ${{ github.ref_name }})" >> $GITHUB_ENV
5257
- name: Generate macOS package
5358
shell: bash
5459
run: |
55-
./macosx/generate-pkg.sh $(pwd)/destdir/usr/local ${{ github.event.pull_request.number || steps.slug.outputs.sha8 }}
60+
./macosx/generate-pkg.sh $(pwd)/destdir/usr/local ${{ github.event.pull_request.number || env.SHA8 }}
5661
- uses: actions/upload-artifact@v3
5762
with:
58-
name: jack2-macOS-intel-${{ github.event.pull_request.number || steps.slug.outputs.sha8 }}
63+
name: jack2-macOS-${{ matrix.target }}-${{ github.event.pull_request.number || env.SHA8 }}
5964
path: macosx/jack2-osx-*.pkg
6065

61-
# macOS native universal build
62-
macos_universal:
63-
runs-on: macos-10.15
66+
windows:
67+
strategy:
68+
matrix:
69+
target: [win32, win64]
70+
runs-on: ubuntu-22.04
6471
steps:
6572
- uses: actions/checkout@v3
6673
with:
@@ -70,54 +77,7 @@ jobs:
7077
with:
7178
path: |
7279
~/PawPawBuilds
73-
key: macos-universal-v${{ env.CACHE_VERSION }}
74-
- name: Set up dependencies
75-
run: |
76-
brew install cmake jq meson
77-
- name: Fix up Xcode
78-
run: |
79-
sudo rm -Rf /Library/Developer/CommandLineTools/SDKs/*
80-
sudo xcode-select -s /Applications/Xcode_12.3.app
81-
- name: Bootstrap macOS universal
82-
shell: bash
83-
run: |
84-
if [ ! -d PawPaw ]; then
85-
git clone https://github.com/DISTRHO/PawPaw.git
86-
git -C PawPaw checkout ${PAWPAW_VERSION}
87-
fi
88-
./PawPaw/bootstrap-jack2.sh macos-universal && ./PawPaw/.cleanup.sh macos-universal
89-
- name: Build jack2
90-
shell: bash
91-
run: |
92-
pushd PawPaw && source local.env macos-universal && popd
93-
python ./waf configure --platform=darwin --prefix=/usr/local
94-
python ./waf build -j $(sysctl -n hw.logicalcpu)
95-
python ./waf install --destdir=$(pwd)/destdir
96-
- name: Set sha8
97-
id: slug
98-
run: echo "::set-output name=sha8::$(echo ${{ github.sha }} | cut -c1-8)"
99-
- name: Generate macOS package
100-
shell: bash
101-
run: |
102-
./macosx/generate-pkg.sh $(pwd)/destdir/usr/local ${{ github.event.pull_request.number || steps.slug.outputs.sha8 }}
103-
- uses: actions/upload-artifact@v3
104-
with:
105-
name: jack2-macOS-universal-${{ github.event.pull_request.number || steps.slug.outputs.sha8 }}
106-
path: macosx/jack2-osx-*.pkg
107-
108-
# linux with win32 cross-compilation
109-
win32:
110-
runs-on: ubuntu-20.04
111-
steps:
112-
- uses: actions/checkout@v3
113-
with:
114-
submodules: recursive
115-
- name: Set up cache
116-
uses: actions/cache@v3
117-
with:
118-
path: |
119-
~/PawPawBuilds
120-
key: win32-v${{ env.CACHE_VERSION }}
80+
key: ${{ matrix.target }}-v${{ env.CACHE_VERSION }}
12181
- name: Restore debian packages cache
12282
run: |
12383
if [ -d ~/PawPawBuilds/debs ] && [ "$(ls ~/PawPawBuilds/debs | wc -l)" -ne 0 ]; then \
@@ -126,119 +86,50 @@ jobs:
12686
- name: Fix GitHub's mess
12787
run: |
12888
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
89+
sudo dpkg --add-architecture i386
12990
sudo apt-get update -qq
130-
sudo apt-get install -yqq --allow-downgrades libgd3/focal libpcre2-8-0/focal libpcre2-16-0/focal libpcre2-32-0/focal libpcre2-posix2/focal
131-
sudo apt-get purge -yqq libmono* moby* mono* php* libgdiplus libpcre2-posix3 libzip4
91+
sudo apt-get install -yqq --allow-downgrades libc6:i386 libgcc-s1:i386 libstdc++6:i386
13292
- name: Set up dependencies
93+
if: ${{ matrix.target == 'win32' }}
13394
run: |
134-
sudo dpkg --add-architecture i386
135-
sudo apt-get update -qq
13695
sudo apt-get install -y autopoint build-essential curl cmake jq llvm mingw-w64 xvfb \
13796
binutils-mingw-w64-i686 g++-mingw-w64-i686 mingw-w64 wine-stable:i386
97+
- name: Set up dependencies
98+
if: ${{ matrix.target == 'win64' }}
99+
run: |
100+
sudo apt-get install -y autopoint build-essential curl cmake jq llvm mingw-w64 xvfb \
101+
binutils-mingw-w64-x86-64 g++-mingw-w64-x86-64 mingw-w64 wine-stable
138102
- name: Cache debian packages
139103
run: |
140104
mkdir -p ~/PawPawBuilds/debs && \
141105
sudo mv /var/cache/apt/archives/*.deb ~/PawPawBuilds/debs/
142-
- name: Bootstrap win32 cross-compiled
106+
- name: Bootstrap dependencies
143107
shell: bash
144108
run: |
145109
if [ ! -d PawPaw ]; then
146110
git clone https://github.com/DISTRHO/PawPaw.git
147111
git -C PawPaw checkout ${PAWPAW_VERSION}
148112
fi
149-
./PawPaw/bootstrap-jack2.sh win32 && ./PawPaw/.cleanup.sh win32
113+
./PawPaw/bootstrap-jack2.sh ${{ matrix.target }} && ./PawPaw/.cleanup.sh ${{ matrix.target }}
150114
- name: Build jack2
151115
shell: bash
152116
run: |
153-
pushd PawPaw && source local.env win32 && popd
154-
./waf configure --platform=win32 --prefix=$(pwd)/destdir --static
117+
pushd PawPaw && source local.env ${{ matrix.target }} && popd
118+
export PATH+=":/usr/i686-w64-mingw32/bin"
119+
export LDFLAGS+="-L~/PawPawBuilds/targets/win64/lib32"
120+
./waf configure --platform=win32 --prefix=$(pwd)/destdir --static ${{ matrix.target == 'win64' && '--mixed' || '' }}
155121
./waf build -j $(nproc)
156122
./waf install
157123
- name: Generate MSVC lib files
158-
shell: bash
124+
if: ${{ matrix.target == 'win32' }}
159125
run: |
160126
pushd $(pwd)/destdir/lib
161127
llvm-dlltool -m i386 -D libjack.dll -d libjack.def -l libjack.lib
162128
llvm-dlltool -m i386 -D libjacknet.dll -d libjacknet.def -l libjacknet.lib
163129
llvm-dlltool -m i386 -D libjackserver.dll -d libjackserver.def -l libjackserver.lib
164130
popd
165-
- name: Set sha8
166-
id: slug
167-
run: echo "::set-output name=sha8::$(echo ${{ github.sha }} | cut -c1-8)"
168-
- name: Generate Windows installer
169-
shell: bash
170-
run: |
171-
# Setup wine
172-
export WINEDLLOVERRIDES="mscoree,mshtml="
173-
export WINEPREFIX=$(pwd)/innosetup
174-
xvfb-run wineboot -u
175-
# Download and install innosetup
176-
curl -L https://jrsoftware.org/download.php/is.exe?site=2 -o is.exe
177-
xvfb-run wine is.exe /allusers /dir=C:\\InnoSeup /nocancel /norestart /verysilent
178-
# create installer
179-
ln -sf $(pwd)/destdir windows/inno/win32
180-
pushd windows/inno
181-
echo "#define VERSION \"${{ github.event.pull_request.number || steps.slug.outputs.sha8 }}\"" > version.iss
182-
xvfb-run wine ${WINEPREFIX}/drive_c/InnoSeup/ISCC.exe win32-mini.iss
183-
popd
184-
- uses: actions/upload-artifact@v3
185-
with:
186-
name: jack2-win32-${{ github.event.pull_request.number || steps.slug.outputs.sha8 }}
187-
path: windows/inno/jack2-*.exe
188-
189-
# linux with win64 cross-compilation
190-
win64:
191-
runs-on: ubuntu-20.04
192-
steps:
193-
- uses: actions/checkout@v3
194-
with:
195-
submodules: recursive
196-
- name: Set up cache
197-
uses: actions/cache@v3
198-
with:
199-
path: |
200-
~/PawPawBuilds
201-
key: win64-v${{ env.CACHE_VERSION }}
202-
- name: Restore debian packages cache
203-
run: |
204-
if [ -d ~/PawPawBuilds/debs ] && [ "$(ls ~/PawPawBuilds/debs | wc -l)" -ne 0 ]; then \
205-
sudo cp ~/PawPawBuilds/debs/*.deb /var/cache/apt/archives/; \
206-
fi
207-
- name: Fix GitHub's mess
208-
run: |
209-
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
210-
sudo apt-get update -qq
211-
sudo apt-get install -yqq --allow-downgrades libgd3/focal libpcre2-8-0/focal libpcre2-16-0/focal libpcre2-32-0/focal libpcre2-posix2/focal
212-
sudo apt-get purge -yqq libmono* moby* mono* php* libgdiplus libpcre2-posix3 libzip4
213-
- name: Set up dependencies
214-
run: |
215-
sudo dpkg --add-architecture i386
216-
sudo apt-get update -qq
217-
sudo apt-get install -y autopoint build-essential curl cmake jq llvm mingw-w64 xvfb \
218-
binutils-mingw-w64-x86-64 g++-mingw-w64-x86-64 mingw-w64 wine-stable
219-
- name: Cache debian packages
220-
run: |
221-
mkdir -p ~/PawPawBuilds/debs && \
222-
sudo mv /var/cache/apt/archives/*.deb ~/PawPawBuilds/debs/
223-
- name: Bootstrap win64 cross-compiled
224-
shell: bash
225-
run: |
226-
if [ ! -d PawPaw ]; then
227-
git clone https://github.com/DISTRHO/PawPaw.git
228-
git -C PawPaw checkout ${PAWPAW_VERSION}
229-
fi
230-
./PawPaw/bootstrap-jack2.sh win64 && ./PawPaw/.cleanup.sh win64
231-
- name: Build jack2
232-
shell: bash
233-
run: |
234-
pushd PawPaw && source local.env win64 && popd
235-
export PATH+=":/usr/i686-w64-mingw32/bin"
236-
export LDFLAGS+="-L~/PawPawBuilds/targets/win64/lib32"
237-
./waf configure --platform=win32 --prefix=$(pwd)/destdir --static --mixed
238-
./waf build -j $(nproc)
239-
./waf install
240131
- name: Generate MSVC lib files
241-
shell: bash
132+
if: ${{ matrix.target == 'win64' }}
242133
run: |
243134
# 32bit
244135
pushd $(pwd)/destdir/lib32
@@ -250,9 +141,12 @@ jobs:
250141
llvm-dlltool -m i386:x86-64 -D libjacknet64.dll -d libjacknet64.def -l libjacknet64.lib
251142
llvm-dlltool -m i386:x86-64 -D libjackserver64.dll -d libjackserver64.def -l libjackserver64.lib
252143
popd
253-
- name: Set sha8
254-
id: slug
255-
run: echo "::set-output name=sha8::$(echo ${{ github.sha }} | cut -c1-8)"
144+
- name: Set sha8 (non-release)
145+
if: startsWith(github.ref, 'refs/tags/') != true
146+
run: echo "SHA8=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV
147+
- name: Set sha8 (release)
148+
if: startsWith(github.ref, 'refs/tags/')
149+
run: echo "SHA8=$(echo ${{ github.ref_name }})" >> $GITHUB_ENV
256150
- name: Generate Windows installer
257151
shell: bash
258152
run: |
@@ -262,60 +156,14 @@ jobs:
262156
xvfb-run wineboot -u
263157
# Download and install innosetup
264158
curl -L https://jrsoftware.org/download.php/is.exe?site=2 -o is.exe
265-
xvfb-run wine64 is.exe /allusers /dir=C:\\InnoSeup /nocancel /norestart /verysilent
159+
xvfb-run wine is.exe /allusers /dir=C:\\InnoSeup /nocancel /norestart /verysilent
266160
# create installer
267-
ln -sf $(pwd)/destdir windows/inno/win64
161+
ln -sf $(pwd)/destdir windows/inno/${{ matrix.target }}
268162
pushd windows/inno
269-
echo "#define VERSION \"${{ github.event.pull_request.number || steps.slug.outputs.sha8 }}\"" > version.iss
270-
xvfb-run wine64 ${WINEPREFIX}/drive_c/InnoSeup/ISCC.exe win64-mini.iss
163+
echo "#define VERSION \"${{ github.event.pull_request.number || env.SHA8 }}\"" > version.iss
164+
xvfb-run wine ${WINEPREFIX}/drive_c/InnoSeup/ISCC.exe ${{ matrix.target }}-mini.iss
271165
popd
272166
- uses: actions/upload-artifact@v3
273167
with:
274-
name: jack2-win64-${{ github.event.pull_request.number || steps.slug.outputs.sha8 }}
168+
name: jack2-${{ matrix.target }}-${{ github.event.pull_request.number || env.SHA8 }}
275169
path: windows/inno/jack2-*.exe
276-
277-
# ubuntu-20.04
278-
#ubuntu_20_04:
279-
#runs-on: ubuntu-20.04
280-
#steps:
281-
#- uses: actions/checkout@v3
282-
#with:
283-
#submodules: recursive
284-
#- name: Set up cache
285-
#uses: actions/cache@v3
286-
#with:
287-
#path: |
288-
#~/debs
289-
#key: ubuntu-20.04-v${{ env.CACHE_VERSION }}
290-
#- name: Restore debian packages cache
291-
#run: |
292-
#if [ -d ~/debs ] && [ "$(ls ~/debs | wc -l)" -ne 0 ]; then \
293-
#sudo cp ~/debs/*.deb /var/cache/apt/archives/; \
294-
#fi
295-
#- name: Set up dependencies
296-
#run: |
297-
#sudo add-apt-repository -y ppa:ubuntustudio-ppa/backports
298-
#sudo sed -i "s/# deb-src/deb-src/" /etc/apt/sources.list /etc/apt/sources.list.d/*.list
299-
#sudo apt-get update -qq
300-
#sudo apt-get build-dep jackd2
301-
#sudo apt-get install devscripts
302-
#- name: Cache debian packages
303-
#run: |
304-
#mkdir -p ~/debs && \
305-
#sudo mv /var/cache/apt/archives/*.deb ~/debs/
306-
#- name: Set sha8
307-
#id: slug
308-
#run: echo "::set-output name=sha8::$(echo ${{ github.sha }} | cut -c1-8)"
309-
#- name: Build jack2 packages
310-
#shell: bash
311-
#run: |
312-
#apt-get source -d jackd2
313-
#tar xf *.debian.tar.xz
314-
#rm -rf debian/source
315-
#sed -i "s|--prefix=/usr --classic|--prefix=/usr --classic|" debian/rules
316-
#dch -M -b -v "$(cat wscript | awk 'sub("^VERSION = ","")' | tr -d "'")~$(date +"%Y%m%d")git${{ github.event.pull_request.number || steps.slug.outputs.sha8 }}" -D focal "automated build"
317-
#debuild -rfakeroot --no-lintian || true
318-
#- uses: actions/upload-artifact@v3
319-
#with:
320-
#name: jack2-ubuntu-20.04-${{ github.event.pull_request.number || steps.slug.outputs.sha8 }}
321-
#path: ~/work/jack2/*.deb

0 commit comments

Comments
 (0)