summaryrefslogtreecommitdiffstats
path: root/contrib/release/upload-release.sh
blob: 3c2abdd765320a85072a07209704bf6daa56b6a2 (plain)
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
#!/bin/sh -x

set -e

pwd=$(pwd -P)

version=$(cat VERSION)

tag=dwz-$version
rootdir=dwz
tarfile=dwz-$version.tar
server=sourceware.org
ftpdir=/sourceware/ftp/pub/dwz/releases
# The server itself seems to add a sha512.sum file, so lets not duplicate that
# effort.
#checksums="md5sum sha512sum"
checksums="md5sum"

repo="$pwd"

dir=$(mktemp -d)

cd $dir
git clone \
    $repo \
    $rootdir

cd $dir/$rootdir
git ch $tag

rm -Rf .git

cd $dir
tar cvf \
    $tarfile \
    $rootdir

xz \
    --best \
    -k \
    $tarfile

gzip \
    --best \
    -k \
    $tarfile

files=$(echo $tarfile.*)

[ "$files" != "" ]

ssh $server \
    "mkdir -p $ftpdir"

scp \
    $files \
    "$server:$ftpdir"

ssh $server \
    "cd $ftpdir && chmod 644 $files"

for checksum in $checksums; do
    ssh $server \
	"cd $ftpdir && touch $checksum && chmod 644 $checksum && ( $checksum $files >> $checksum )"
done

rm -Rf $dir