summaryrefslogtreecommitdiffstats
path: root/config/upload-release.sh
blob: a44d40c90dea557dcd205957f96f153669ef13ef (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
#!/bin/bash

# Must be run in the source directory.
# Should have passed make distcheck.
# And all final changes should already have been pushed.
# Backup copy will be created in $HOME/elfutils-$VERSION

# Any error is fatal
set -e

# We take one arguent, the version (e.g. 0.173)
if [ $# -ne 1 ]; then
  echo "$0 <version> (e.g. 0.169)"
  exit 1
fi

VERSION="$1"

echo Make sure the git repo is tagged, signed and pushed
echo git tag -s -m \"elfutils $VERSION release\" elfutils-$VERSION
echo git push --tags

# Create a temporary directoy and make sure it is cleaned up.
tempdir=$(mktemp -d) || exit
trap "rm -rf -- ${tempdir}" EXIT

pushd "${tempdir}"

# Checkout
git clone git://sourceware.org/git/elfutils.git
cd elfutils
git checkout -b "$VERSION" "elfutils-${VERSION}"

# Create dist
autoreconf -v -f -i
./configure --enable-maintainer-mode
make dist

# Sign
mkdir $VERSION
cp elfutils-$VERSION.tar.bz2 $VERSION/
cd $VERSION/
gpg -b elfutils-$VERSION.tar.bz2
cd ..

# Backup copy
cp -r $VERSION $HOME/elfutils-$VERSION

# Upload
scp -r $VERSION sourceware.org:/sourceware/ftp/pub/elfutils/
ssh sourceware.org "(cd /sourceware/ftp/pub/elfutils \
  && ln -sf $VERSION/elfutils-$VERSION.tar.bz2 elfutils-latest.tar.bz2 \
  && ln -sf $VERSION/elfutils-$VERSION.tar.bz2.sig elfutils-latest.tar.bz2.sig \
  && ls -lah elfutils-latest*)"

# Cleanup
popd
trap - EXIT
exit