File tree Expand file tree Collapse file tree 2 files changed +56
-0
lines changed Expand file tree Collapse file tree 2 files changed +56
-0
lines changed Original file line number Diff line number Diff line change @@ -136,3 +136,17 @@ jobs:
136
136
labels : ${{ steps.meta.outputs.labels }}
137
137
cache-from : type=gha
138
138
cache-to : type=gha,mode=max
139
+
140
+ - name : Create draft release
141
+ # Triggered only on tag creation
142
+ if : github.event_name == 'push' && contains(github.ref, 'refs/tags/')
143
+ run : |
144
+ sudo apt install zip -y
145
+ ls build
146
+ mv build/main.wasm build/coraza-proxy-wasm.wasm
147
+ tag="${GITHUB_REF#refs/tags/}"
148
+ zip -j build/coraza-proxy-wasm-${tag}.zip build/coraza-proxy-wasm.wasm
149
+ ./.github/workflows/release_notes.sh ${tag} > release-notes.txt
150
+ gh release create ${tag} --draft --notes-file release-notes.txt --title ${GITHUB_REF#refs/tags/} ./build/coraza-proxy-wasm-${tag}.zip
151
+ env :
152
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change
1
+ #! /bin/sh -ue
2
+ # Copyright The OWASP Coraza contributors
3
+ # SPDX-License-Identifier: Apache-2.0
4
+
5
+ #
6
+ # Highly inspired by https://github.com/tetratelabs/wazero/blob/main/.github/workflows/release_notes.sh
7
+ #
8
+ # This script generates the release notes for a specific release tag.
9
+ # .github/workflows/release_notes.sh v1.3.0
10
+
11
+ tag=$1
12
+ prior_tag=$( git tag -l ' v*' | sed " /${tag} /,+10d" | tail -1)
13
+ if [ -n " ${prior_tag} " ]; then
14
+ range=" ${prior_tag} ..${tag} "
15
+ else
16
+ range=${tag}
17
+ fi
18
+
19
+ git config log.mailmap true
20
+ changelog=$( git log --format=' %h %s %aN, %(trailers:key=co-authored-by)' " ${range} " )
21
+
22
+ # strip the v off the tag name more shell portable than ${tag:1}
23
+ version=$( echo " ${tag} " | cut -c2-100) || exit 1
24
+ cat << EOF
25
+ coraza-proxy-wasm ${version}
26
+
27
+ TODO: classify the below into up to 4 major headings and the rest as bulleted items in other changes
28
+ The published release notes should only include the summary statement in this section.
29
+
30
+ ${changelog}
31
+
32
+ ## X packages
33
+
34
+ Don't forget to cite who was involved and why
35
+
36
+ ## Other changes
37
+
38
+ TODO: don't add trivial things like fixing spaces or non-concerns like build glitches
39
+
40
+ * Z is now fixed thanks to Yogi Bear
41
+
42
+ EOF
You can’t perform that action at this time.
0 commit comments