-
Notifications
You must be signed in to change notification settings - Fork 192
326 lines (281 loc) · 8.74 KB
/
release.yml
File metadata and controls
326 lines (281 loc) · 8.74 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
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
name: "Release"
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+*'
workflow_dispatch:
inputs:
tag:
description: 'Tag to release (e.g., 0.20.0 or 0.20.0-rc1)'
required: true
permissions:
contents: write
jobs:
validate:
name: Validate release
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
is_prerelease: ${{ steps.version.outputs.is_prerelease }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Determine version
id: version
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
VERSION="${{ github.event.inputs.tag }}"
else
VERSION="${GITHUB_REF#refs/tags/}"
fi
VERSION="${VERSION#v}"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
if echo "$VERSION" | grep -qE '-(rc|alpha|beta)'; then
echo "is_prerelease=true" >> "$GITHUB_OUTPUT"
else
echo "is_prerelease=false" >> "$GITHUB_OUTPUT"
fi
echo "Version: $VERSION"
- name: Validate version consistency
run: |
chmod +x scripts/validate-version.sh
scripts/validate-version.sh "${{ steps.version.outputs.version }}"
- name: Extract release notes
run: |
chmod +x scripts/extract-release-notes.sh
scripts/extract-release-notes.sh "${{ steps.version.outputs.version }}" > release-notes.md
echo "--- Release notes ---"
cat release-notes.md
- name: Upload release notes
uses: actions/upload-artifact@v4
with:
name: release-notes
path: release-notes.md
build-dist:
name: Build distribution tarball
runs-on: ubuntu-latest
needs: validate
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y autoconf automake libtool libgnutls28-dev libcurl4-openssl-dev
- name: Fetch libmicrohttpd from cache
id: cache-libmicrohttpd
uses: actions/cache@v4
with:
path: libmicrohttpd-0.9.77
key: ubuntu-latest-gcc-libmicrohttpd-0.9.77-pre-built-v2
- name: Build libmicrohttpd (if not cached)
if: steps.cache-libmicrohttpd.outputs.cache-hit != 'true'
run: |
curl https://s3.amazonaws.com/libhttpserver/libmicrohttpd_releases/libmicrohttpd-0.9.77.tar.gz -o libmicrohttpd-0.9.77.tar.gz
tar -xzf libmicrohttpd-0.9.77.tar.gz
cd libmicrohttpd-0.9.77
./configure --disable-examples
make
- name: Install libmicrohttpd
run: |
cd libmicrohttpd-0.9.77
sudo make install
sudo ldconfig
- name: Build libhttpserver
run: |
./bootstrap
mkdir build
cd build
../configure
make
make check
- name: Create distribution tarball
run: |
cd build
make dist
- name: Upload tarball
uses: actions/upload-artifact@v4
with:
name: dist-tarball
path: build/libhttpserver-*.tar.gz
verify-dist-linux:
name: Verify tarball (Linux)
runs-on: ubuntu-latest
needs: build-dist
steps:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libgnutls28-dev libcurl4-openssl-dev
- name: Fetch libmicrohttpd from cache
id: cache-libmicrohttpd
uses: actions/cache@v4
with:
path: libmicrohttpd-0.9.77
key: ubuntu-latest-gcc-libmicrohttpd-0.9.77-pre-built-v2
- name: Build libmicrohttpd (if not cached)
if: steps.cache-libmicrohttpd.outputs.cache-hit != 'true'
run: |
curl https://s3.amazonaws.com/libhttpserver/libmicrohttpd_releases/libmicrohttpd-0.9.77.tar.gz -o libmicrohttpd-0.9.77.tar.gz
tar -xzf libmicrohttpd-0.9.77.tar.gz
cd libmicrohttpd-0.9.77
./configure --disable-examples
make
- name: Install libmicrohttpd
run: |
cd libmicrohttpd-0.9.77
sudo make install
sudo ldconfig
- name: Download tarball
uses: actions/download-artifact@v4
with:
name: dist-tarball
- name: Build and test from tarball
run: |
tar -xzf libhttpserver-*.tar.gz
cd libhttpserver-*/
mkdir build
cd build
../configure
make
make check
- name: Print test results on failure
if: failure()
run: |
cd libhttpserver-*/build
cat test/test-suite.log || true
verify-dist-macos:
name: Verify tarball (macOS)
runs-on: macos-latest
needs: build-dist
steps:
- name: Install build tools
run: brew install autoconf automake libtool
- name: Fetch libmicrohttpd from cache
id: cache-libmicrohttpd
uses: actions/cache@v4
with:
path: libmicrohttpd-0.9.77
key: macos-latest-gcc-libmicrohttpd-0.9.77-pre-built-v2
- name: Build libmicrohttpd (if not cached)
if: steps.cache-libmicrohttpd.outputs.cache-hit != 'true'
run: |
curl https://s3.amazonaws.com/libhttpserver/libmicrohttpd_releases/libmicrohttpd-0.9.77.tar.gz -o libmicrohttpd-0.9.77.tar.gz
tar -xzf libmicrohttpd-0.9.77.tar.gz
cd libmicrohttpd-0.9.77
./configure --disable-examples
make
- name: Install libmicrohttpd
run: |
cd libmicrohttpd-0.9.77
sudo make install
- name: Fetch curl from cache
id: cache-curl
uses: actions/cache@v4
with:
path: curl-7.75.0
key: macos-latest-CURL-pre-built-v2
- name: Build curl (if not cached)
if: steps.cache-curl.outputs.cache-hit != 'true'
run: |
curl https://libhttpserver.s3.amazonaws.com/travis_stuff/curl-7.75.0.tar.gz -o curl-7.75.0.tar.gz
tar -xzf curl-7.75.0.tar.gz
cd curl-7.75.0
./configure --with-darwinssl --without-ssl
make
- name: Install curl
run: |
cd curl-7.75.0
sudo make install
- name: Download tarball
uses: actions/download-artifact@v4
with:
name: dist-tarball
- name: Build and test from tarball
run: |
tar -xzf libhttpserver-*.tar.gz
cd libhttpserver-*/
mkdir build
cd build
CFLAGS='-mtune=generic' ../configure --disable-fastopen
make
make check
- name: Print test results on failure
if: failure()
run: |
cd libhttpserver-*/build
cat test/test-suite.log || true
verify-dist-windows:
name: Verify tarball (Windows)
runs-on: windows-latest
needs: build-dist
defaults:
run:
shell: msys2 {0}
steps:
- name: Setup MSYS2
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: >-
autotools
base-devel
- name: Install MinGW64 packages
run: |
pacman --noconfirm -S --needed mingw-w64-x86_64-{toolchain,libtool,make,pkg-config,libsystre,doxygen,gnutls,graphviz,curl}
- name: Build and install libmicrohttpd
run: |
curl https://s3.amazonaws.com/libhttpserver/libmicrohttpd_releases/libmicrohttpd-0.9.77.tar.gz -o libmicrohttpd-0.9.77.tar.gz
tar -xzf libmicrohttpd-0.9.77.tar.gz
cd libmicrohttpd-0.9.77
./configure --disable-examples --enable-poll=no
make
make install
- name: Download tarball
uses: actions/download-artifact@v4
with:
name: dist-tarball
- name: Build and test from tarball
run: |
tar -xzf libhttpserver-*.tar.gz
cd libhttpserver-*/
mkdir build
cd build
../configure --disable-fastopen
make
make check
- name: Print test results on failure
if: failure()
run: |
cd libhttpserver-*/build
cat test/test-suite.log || true
release:
name: Create GitHub Release
runs-on: ubuntu-latest
needs: [validate, verify-dist-linux, verify-dist-macos, verify-dist-windows]
steps:
- name: Download tarball
uses: actions/download-artifact@v4
with:
name: dist-tarball
- name: Download release notes
uses: actions/download-artifact@v4
with:
name: release-notes
- name: Create release
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
run: |
VERSION="${{ needs.validate.outputs.version }}"
IS_PRERELEASE="${{ needs.validate.outputs.is_prerelease }}"
PRERELEASE_FLAG=""
if [ "$IS_PRERELEASE" = "true" ]; then
PRERELEASE_FLAG="--prerelease"
fi
gh release create "$VERSION" \
--title "libhttpserver $VERSION" \
--notes-file release-notes.md \
$PRERELEASE_FLAG \
libhttpserver-*.tar.gz