summaryrefslogtreecommitdiffstats
path: root/build-aux/maintainer-upload-release
blob: 3893c5b87fb339edb48471df95e50685604ac421 (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
#!/bin/bash
set -ex
: "${MESON_BUILD_ROOT:?}"
: "${MESON_SOURCE_ROOT:?}"
project_name="${1:?project name is required}"
project_version="${2:?project version is required}"
tarball_basename="${project_name}-${project_version}.tar.xz"
tarball_path="${MESON_BUILD_ROOT}/meson-dist/${tarball_basename}"
[[ -e "$tarball_path" ]]  # ninja dist must have been successful

gnome_series=${project_version%.*}
expected_branch=gnome-${gnome_series/./-}

pushd "$MESON_SOURCE_ROOT"
    branch=$(git rev-parse --abbrev-ref HEAD)
    if [[ "$branch" != "master" ]] && [[ "$branch" != "$expected_branch" ]]; then
        echo "Project version $project_version does not match branch $branch" >&2
        exit 1
    fi
    if type git-evtag &>/dev/null; then
        # Can't specify tag message on command line
        # https://github.com/cgwalters/git-evtag/issues/9
        EDITOR=true git evtag sign "$project_version"
    else
        git tag -s "$project_version" -m "Version $project_version"
    fi
    git push --atomic origin "$branch" "$project_version"
popd

scp "$tarball_path" master.gnome.org:
# shellcheck disable=SC2029
ssh master.gnome.org ftpadmin install "$tarball_basename"