File: generate-release-notes

package info (click to toggle)
ccache 4.12.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,188 kB
  • sloc: cpp: 47,282; asm: 28,570; sh: 8,674; ansic: 5,357; python: 685; perl: 68; makefile: 23
file content (48 lines) | stat: -rwxr-xr-x 1,242 bytes parent folder | download
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
#!/bin/bash

set -euo pipefail

version=$(echo "$1" | sed 's/^v//')
u_version=$(echo "${version}" | sed 's/\./_/g')
url_prefix="https://github.com/ccache/ccache/releases/download/v${version}"

source_extensions=(tar.gz tar.xz)
linux_archs=(aarch64 x86_64)
windows_archs=(aarch64 i686 x86_64)

retcode=0

add() {
    local descr=$1
    local file=$2

    for f in "${file}" "${file}.minisig"; do
        if [[ ! -f "${f}" ]]; then
            echo "Error: ${f} does not exist" >&2
            retcode=1
        fi
    done
cat <<EOF
* [${descr}](${url_prefix}/${file}) ([signature](${url_prefix}/${file}.minisig))
EOF
}

cd release

for ext in "${source_extensions[@]}"; do
    add "Generic source code release (${ext})" "ccache-${version}.${ext}"
done
add "Darwin (macOS) universal binary release" "ccache-${version}-darwin.tar.gz"
for arch in "${linux_archs[@]}"; do
    add "Linux ${arch} binary release" "ccache-${version}-linux-${arch}.tar.xz"
done
for arch in "${windows_archs[@]}"; do
    add "Windows ${arch} binary release" "ccache-${version}-windows-${arch}.zip"
done

cat <<EOF
* [Release notes](https://ccache.dev/releasenotes.html#_ccache_${u_version})
* [Manual](https://ccache.dev/manual/${version}.html)
EOF

exit "${retcode}"