-
Notifications
You must be signed in to change notification settings - Fork 6
222 lines (210 loc) · 6.34 KB
/
build.yml
File metadata and controls
222 lines (210 loc) · 6.34 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
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: build
on:
push:
branches:
- '*'
tags:
- '[0-9]*'
- 'v[0-9]*'
pull_request:
branches:
- '*'
jobs:
build_for_linux:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Set up dependencies
run: |
sudo apt-get update && \
sudo apt-get install \
build-essential \
zip \
libfftw3-dev \
libjack-jackd2-dev \
libgl-dev \
libx11-dev
- name: Build all
shell: bash
run: make -j $(nproc)
build_for_win32:
runs-on: ubuntu-18.04
container:
image: archlinux
steps:
- name: Set install name
run: |
echo "install_ref=${GITHUB_REF##*/}" >> "$GITHUB_ENV"
echo "install_name=spectacle-analyzer-${GITHUB_REF##*/}-win32" >> "$GITHUB_ENV"
- name: Configure pacman repositories
shell: bash
run: |
cat >>/etc/pacman.conf <<EOF
[multilib]
Include = /etc/pacman.d/mirrorlist
[mingw-w64]
SigLevel = Optional TrustAll
Server = https://github.com/jpcima/arch-mingw-w64/releases/download/repo.\$arch/
EOF
- name: Set up dependencies
shell: bash
run: |
pacman -Sqyu --noconfirm
pacman -Sq --needed --noconfirm \
base-devel \
git \
zip \
wine \
mingw-w64-gcc \
mingw-w64-pkg-config \
mingw-w64-fftw
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Build
shell: bash
run: |
export AR=i686-w64-mingw32-ar
export RANLIB=i686-w64-mingw32-ranlib
export CC=i686-w64-mingw32-gcc
export CXX=i686-w64-mingw32-g++
export STRIP=i686-w64-mingw32-strip
export WINDRES=i686-w64-mingw32-windres
export PKG_CONFIG=i686-w64-mingw32-pkg-config
export PKG_CONFIG="$PKG_CONFIG --static"
export WINEDEBUG=-all
export WINEPREFIX=~/my-wine-prefix
mkdir -p "$WINEPREFIX"
CROSS_COMPILING=true EXE_WRAPPER=wine WINDOWS=true make -j $(nproc)
- name: Install
shell: bash
run: |
mv -f bin "${{env.install_name}}"
zip -r "${{env.install_name}}.zip" "${{env.install_name}}"
- uses: actions/upload-artifact@v2
with:
name: Windows 32-bit binaries
path: ${{env.install_name}}.zip
build_for_win64:
runs-on: ubuntu-18.04
container:
image: archlinux
steps:
- name: Set install name
run: |
echo "install_ref=${GITHUB_REF##*/}" >> "$GITHUB_ENV"
echo "install_name=spectacle-analyzer-${GITHUB_REF##*/}-win64" >> "$GITHUB_ENV"
- name: Configure pacman repositories
shell: bash
run: |
cat >>/etc/pacman.conf <<EOF
[multilib]
Include = /etc/pacman.d/mirrorlist
[mingw-w64]
SigLevel = Optional TrustAll
Server = https://github.com/jpcima/arch-mingw-w64/releases/download/repo.\$arch/
EOF
- name: Set up dependencies
shell: bash
run: |
pacman -Sqyu --noconfirm
pacman -Sq --needed --noconfirm \
base-devel \
git \
zip \
wine \
mingw-w64-gcc \
mingw-w64-pkg-config \
mingw-w64-fftw
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Build
shell: bash
run: |
export AR=x86_64-w64-mingw32-ar
export RANLIB=x86_64-w64-mingw32-ranlib
export CC=x86_64-w64-mingw32-gcc
export CXX=x86_64-w64-mingw32-g++
export STRIP=x86_64-w64-mingw32-strip
export WINDRES=x86_64-w64-mingw32-windres
export PKG_CONFIG=x86_64-w64-mingw32-pkg-config
export PKG_CONFIG="$PKG_CONFIG --static"
export WINEDEBUG=-all
export WINEPREFIX=~/my-wine-prefix
mkdir -p "$WINEPREFIX"
CROSS_COMPILING=true EXE_WRAPPER=wine WINDOWS=true make -j $(nproc)
- name: Install
shell: bash
run: |
mv -f bin "${{env.install_name}}"
zip -r "${{env.install_name}}.zip" "${{env.install_name}}"
- uses: actions/upload-artifact@v2
with:
name: Windows 64-bit binaries
path: ${{env.install_name}}.zip
archive_source_code:
runs-on: ubuntu-18.04
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Set install name
run: |
echo "install_ref=${GITHUB_REF##*/}" >> "$GITHUB_ENV"
echo "install_name=spectacle-analyzer-${GITHUB_REF##*/}" >> "$GITHUB_ENV"
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Set up dependencies
run: |
sudo apt-get update && \
sudo apt-get install \
python-pip
sudo pip install git-archive-all
- name: Archive source code
shell: bash
run: |
cd "$GITHUB_WORKSPACE" && \
git-archive-all --prefix="${install_name}/" -9 "${{runner.workspace}}/${install_name}.tar.gz"
- uses: actions/upload-artifact@v2
with:
name: Source code tarball
path: ${{runner.workspace}}/${{env.install_name}}.tar.gz
deploy:
runs-on: ubuntu-18.04
if: startsWith(github.ref, 'refs/tags/')
needs:
- build_for_win32
- build_for_win64
steps:
- name: Set install name
run: |
echo "install_ref=${GITHUB_REF##*/}" >> "$GITHUB_ENV"
- uses: actions/download-artifact@v2
with:
name: Windows 32-bit binaries
- uses: actions/download-artifact@v2
with:
name: Windows 64-bit binaries
- uses: actions/download-artifact@v2
with:
name: Source code tarball
- name: Display file information
shell: bash
run: ls -lR
## Note: not using `actions/create-release@v1`
## because it cannot update an existing release
## see https://github.com/actions/create-release/issues/29
- uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{secrets.TOKEN}}
with:
tag_name: ${{env.install_ref}}
name: Release ${{env.install_ref}}
draft: false
prerelease: false
files: |
spectacle-analyzer-${{env.install_ref}}-win32.zip
spectacle-analyzer-${{env.install_ref}}-win64.zip
spectacle-analyzer-${{env.install_ref}}.tar.gz