summaryrefslogtreecommitdiff
path: root/tools/release-publish.sh
blob: aae19863e2e8e40e824878ba130dbe09f7615bc1 (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
#!/bin/bash

# Upload a cairomm tarball to cairographics.org/releases

# Before you call this script, make a tarball with 'meson dist' or 'make distcheck'
# as described at https://wiki.gnome.org/MaintainersCorner/Releasing
# but DO NOT upload it to master.gnome.org.

if [ $# -ne 2 ]
then
  echo "Usage: $0 <version> <username>"
  echo "Example: $0 1.14.0 foo"
  exit 1
fi

PACKAGE=cairomm
VERSION=$1
USERNAME=$2
tar_file=$PACKAGE-$VERSION.tar.xz
sha1_file=$tar_file.sha1
gpg_file=$sha1_file.asc

RELEASE_UPLOAD_HOST=cairographics.org
RELEASE_UPLOAD_BASE=/srv/cairo.freedesktop.org/www
RELEASE_UPLOAD_DIR=$RELEASE_UPLOAD_BASE/releases

# Create a checksum file, and sign it.
sha1sum $tar_file >$sha1_file
echo "Please enter your GPG password to sign the checksum."
gpg --armor --sign $sha1_file

# Upload the tarball, checksum file and signature file.
scp $tar_file $sha1_file $gpg_file $USERNAME@$RELEASE_UPLOAD_HOST:$RELEASE_UPLOAD_DIR

# Update the LATEST-$PACKAGE link.
ssh $USERNAME@$RELEASE_UPLOAD_HOST "rm -f $RELEASE_UPLOAD_DIR/LATEST-$PACKAGE-[0-9]* && ln -s $tar_file $RELEASE_UPLOAD_DIR/LATEST-$PACKAGE-$VERSION"

# Move the files to a subdir.
#mkdir -p releases
#mv $tar_file $sha1_file $gpg_file releases