release.sh 16.9 KB
Newer Older
Thomas Haller's avatar
Thomas Haller committed
1
2
#!/bin/bash

3
# Script for doing NetworkManager releases.
Thomas Haller's avatar
Thomas Haller committed
4
#
5
# Run with --help for usage.
Thomas Haller's avatar
Thomas Haller committed
6
#
7
# There are 6 modes:
8
9
10
11
12
13
14
15
#
#  - "devel" : on master branch to tag "1.25.2-dev"
#  - "rc1"   : the first release candidate on "master" branch which branches off
#              "nm-1-26" branch. The tag is "1.26-rc1" with version number 1.25.90.
#  - "rc"    : further release candidates on RC branch "nm-1-26". For example
#              "1.26-rc2" with version number 1.25.91.
#  - "major" : on stable branch nm-1-26 to release 1.26.0. This also merged
#              the release with master branch and does a devel tag like "1.27.2-dev"
16
17
#  - "major-post": after a "major" release, merge the release branch with master and
#              do another devel snapshot on master.
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#  - "minor" : on a stable branch nm-1-26 to do minor release 1.26.4 and bump
#              to "1.26.5-dev".
#
# Requisites:
#
#   * You need to start with a clean working directory (git clean -fdx)
#
#   * Run in a "clean" environment, no unusual environment variables set.
#
#   * First, ensure that you have ssh keys for master.gnome.org installed (and ssh-agent running)
#     Also, ensure you have a GPG key that you want to use for signing. Also, have gpg-agent running
#     and possibly configure `git config --get user.signingkey` for the proper key.
#
#   * Your git repository needs a remote "origin" that points to the upstream git repository.
#
#   * All your (relevant) local branches (master and nm-1-*) must be up to date with their
#     remote tracking branches for origin.
#
# Run with --no-test to do the actual release.
Thomas Haller's avatar
Thomas Haller committed
37
38

die() {
39
40
    echo -n "FAIL: "
    echo_color 31 "$@"
Thomas Haller's avatar
Thomas Haller committed
41
42
43
    exit 1
}

44
echo_color() {
45
46
47
    local color="$1"
    shift
    echo -e -n "\033[0;${color}m"
48
49
50
51
    echo "$@"
    echo -e -n '\033[0m'
}

52
53
print_usage() {
    echo "Usage:"
54
    echo "  $BASH_SOURCE [devel|rc1|rc|major|major-post|minor] [--no-test] [--no-find-backports] [--no-cleanup] [--allow-local-branches]"
55
56
57
58
59
60
61
}

die_help() {
    print_usage
    exit 0
}

Thomas Haller's avatar
Thomas Haller committed
62
die_usage() {
63
64
    echo -n "FAIL: "
    echo_color 31 "$@"
Thomas Haller's avatar
Thomas Haller committed
65
    echo
66
    print_usage
Thomas Haller's avatar
Thomas Haller committed
67
68
69
    exit 1
}

70
do_command() {
71
72
73
74
    local color=36
    if [ "$DRY_RUN" = 0 ]; then
        color=31
    fi
75
    echo -n "COMMAND: "
76
    echo_color $color -n "$@"
77
78
79
80
81
82
    echo
    if [ "$DRY_RUN" = 0 ]; then
        "$@"
    fi
}

Thomas Haller's avatar
Thomas Haller committed
83
parse_version() {
84
85
86
    local MAJ="$(sed -n '1,20 s/^m4_define(\[nm_major_version\], \[\([0-9]\+\)\])$/\1/p' ./configure.ac)"
    local MIN="$(sed -n '1,20 s/^m4_define(\[nm_minor_version\], \[\([0-9]\+\)\])$/\1/p' ./configure.ac)"
    local MIC="$(sed -n '1,20 s/^m4_define(\[nm_micro_version\], \[\([0-9]\+\)\])$/\1/p' ./configure.ac)"
Thomas Haller's avatar
Thomas Haller committed
87

88
    re='^[0-9][1-9]* [0-9][1-9]* [0-9][1-9]*$'
Thomas Haller's avatar
Thomas Haller committed
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
    [[ "$MAJ $MIN $MIC" =~ $re ]] || return 1
    echo "$MAJ $MIN $MIC"
}

number_is_even() {
    local re='^[0-9]*[02468]$'
    [[ "$1" =~ $re ]]
}

number_is_odd() {
    local re='^[0-9]*[13579]$'
    [[ "$1" =~ $re ]]
}

git_same_ref() {
    local a="$(git rev-parse "$1" 2>/dev/null)" || return 1
    local b="$(git rev-parse "$2" 2>/dev/null)" || return 1
    [ "$a" = "$b" ]
}

set_version_number_autotools() {
    sed -i \
        -e '1,20 s/^m4_define(\[nm_major_version\], \[\([0-9]\+\)\])$/m4_define([nm_major_version], ['"$1"'])/' \
        -e '1,20 s/^m4_define(\[nm_minor_version\], \[\([0-9]\+\)\])$/m4_define([nm_minor_version], ['"$2"'])/' \
        -e '1,20 s/^m4_define(\[nm_micro_version\], \[\([0-9]\+\)\])$/m4_define([nm_micro_version], ['"$3"'])/' \
        ./configure.ac
}

set_version_number_meson() {
    sed -i \
        -e '1,20 s/^\( *version: *'\''\)[0-9]\+\.[0-9]\+\.[0-9]\+\('\'',\)$/\1'"$1.$2.$3"'\2/' \
        meson.build
}

set_version_number() {
    set_version_number_autotools "$@" &&
    set_version_number_meson "$@"
}

DO_CLEANUP=1
CLEANUP_CHECKOUT_BRANCH=
CLEANUP_REFS=()
cleanup() {
    if [ $DO_CLEANUP = 1 ]; then
133
        [ -n "$CLEANUP_CHECKOUT_BRANCH" ] && git checkout -f "$CLEANUP_CHECKOUT_BRANCH"
Thomas Haller's avatar
Thomas Haller committed
134
        for c in "${CLEANUP_REFS[@]}"; do
135
            echo "delete reference. Restore with $(echo_color 36 -n git update-ref \"$c\" $(git rev-parse "$c"))"
Thomas Haller's avatar
Thomas Haller committed
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
            git update-ref -d "$c"
        done
    fi
}

trap cleanup EXIT

DIR="$(git rev-parse --show-toplevel)"

ORIGIN=origin

test -d "$DIR" &&
cd "$DIR" &&
test -f ./src/NetworkManagerUtils.h &&
test -f ./contrib/fedora/rpm/build_clean.sh || die "cannot find NetworkManager base directory"

RELEASE_MODE=""
DRY_RUN=1
FIND_BACKPORTS=1
155
ALLOW_LOCAL_BRANCHES=0
156
HELP_AND_EXIT=1
Thomas Haller's avatar
Thomas Haller committed
157
158
159
while [ "$#" -ge 1 ]; do
    A="$1"
    shift
160
    HELP_AND_EXIT=0
Thomas Haller's avatar
Thomas Haller committed
161
162
163
164
165
166
167
168
169
170
    case "$A" in
        --no-test)
            DRY_RUN=0
            ;;
        --no-find-backports)
            FIND_BACKPORTS=0
            ;;
        --no-cleanup)
            DO_CLEANUP=0
            ;;
171
172
173
174
175
176
        --allow-local-branches)
            # by default, the script errors out if the relevant branch (master, nm-1-Y) are not the same
            # as the remote branch on origin. You should not do a release if you have local changes
            # that differ from upstream. Set this flag to override that check.
            ALLOW_LOCAL_BRANCHES=1
            ;;
177
178
179
        --help|-h)
            die_help
            ;;
180
        devel|rc1|rc|major|major-post|minor)
181
182
183
            [ -z "$RELEASE_MODE" ] || die_usage "duplicate release-mode"
            RELEASE_MODE="$A"
            ;;
Thomas Haller's avatar
Thomas Haller committed
184
185
186
187
188
        *)
            die_usage "unknown argument \"$A\""
            ;;
    esac
done
189
190
[ "$HELP_AND_EXIT" = 1 ] && die_help

Thomas Haller's avatar
Thomas Haller committed
191
192
[ -n "$RELEASE_MODE" ] || die_usage "specify the desired release mode"

193
194
195
196
197
VERSION_ARR=( $(parse_version) ) || die "cannot detect NetworkManager version"
VERSION_STR="$(IFS=.; echo "${VERSION_ARR[*]}")"

echo "Current version before release: $VERSION_STR (do \"$RELEASE_MODE\" release)"

198
199
grep -q "version: '${VERSION_ARR[0]}.${VERSION_ARR[1]}.${VERSION_ARR[2]}'," ./meson.build || die "meson.build does not have expected version"

200
201
202
203
204
TMP="$(git status --porcelain)" || die "git status failed"
test -z "$TMP" || die "git working directory is not clean (git status --porcelain)"

TMP="$(LANG=C git clean -ndx)" || die "git clean -ndx failed"
test -z "$TMP" || die "git working directory is not clean? (git clean -ndx)"
Thomas Haller's avatar
Thomas Haller committed
205
206
207
208
209
210

CUR_BRANCH="$(git rev-parse --abbrev-ref HEAD)"
TMP_BRANCH=release-branch

if [ "$CUR_BRANCH" = master ]; then
    number_is_odd "${VERSION_ARR[1]}" || die "Unexpected version number on master. Should be an odd development version"
211
    [ "$RELEASE_MODE" = devel -o "$RELEASE_MODE" = rc1 -o "$RELEASE_MODE" = major-post ] || die "Unexpected branch name \"$CUR_BRANCH\" for \"$RELEASE_MODE\""
Thomas Haller's avatar
Thomas Haller committed
212
else
213
    re='^nm-[0-9][1-9]*-[0-9][1-9]*$'
Thomas Haller's avatar
Thomas Haller committed
214
215
216
    [[ "$CUR_BRANCH" =~ $re ]] || die "Unexpected current branch $CUR_BRANCH. Should be master or nm-?-??"
    if number_is_odd "${VERSION_ARR[1]}"; then
        # we are on a release candiate branch.
217
        [ "$RELEASE_MODE" = rc -o "$RELEASE_MODE" = major ] || die "Unexpected branch name \"$CUR_BRANCH\" for \"$RELEASE_MODE\""
Thomas Haller's avatar
Thomas Haller committed
218
219
        [ "$CUR_BRANCH" == "nm-${VERSION_ARR[0]}-$((${VERSION_ARR[1]} + 1))" ] || die "Unexpected current branch $CUR_BRANCH. Should be nm-${VERSION_ARR[0]}-$((${VERSION_ARR[1]} + 1))"
    else
220
        [ "$RELEASE_MODE" = minor ] || die "Unexpected branch name \"$CUR_BRANCH\" for \"$RELEASE_MODE\""
Thomas Haller's avatar
Thomas Haller committed
221
222
223
224
        [ "$CUR_BRANCH" == "nm-${VERSION_ARR[0]}-${VERSION_ARR[1]}" ] || die "Unexpected current branch $CUR_BRANCH. Should be nm-${VERSION_ARR[0]}-${VERSION_ARR[1]}"
    fi
fi

225
RC_VERSION=
Thomas Haller's avatar
Thomas Haller committed
226
227
228
229
230
231
case "$RELEASE_MODE" in
    minor)
        number_is_even "${VERSION_ARR[1]}" &&
        number_is_odd  "${VERSION_ARR[2]}" || die "cannot do minor release on top of version $VERSION_STR"
        [ "$CUR_BRANCH" != master ] || die "cannot do a minor release on master"
        ;;
232
    devel)
Thomas Haller's avatar
Thomas Haller committed
233
        number_is_odd "${VERSION_ARR[1]}" || die "cannot do devel release on top of version $VERSION_STR"
234
235
236
237
238
239
240
241
242
243
244
245
246
        [ "$((${VERSION_ARR[2]} + 1))" -lt 90 ] || die "devel release must have a micro version smaller than 90 but current version is $VERSION_STR"
        [ "$CUR_BRANCH" == master ] || die "devel release can only be on master"
        ;;
    rc)
        number_is_odd "${VERSION_ARR[1]}" || die "cannot do rc release on top of version $VERSION_STR"
        [ "${VERSION_ARR[2]}" -ge 90 ] || die "rc release must have a micro version larger than ${VERSION_ARR[0]}.90 but current version is $VERSION_STR"
        RC_VERSION="$((${VERSION_ARR[2]} - 88))"
        [ "$CUR_BRANCH" == "nm-${VERSION_ARR[0]}-$((${VERSION_ARR[1]} + 1))" ] || die "devel release can only be on \"nm-${VERSION_ARR[0]}-$((${VERSION_ARR[1]} + 1))\" branch"
        ;;
    major)
        number_is_odd "${VERSION_ARR[1]}" || die "cannot do major release on top of version $VERSION_STR"
        [ "${VERSION_ARR[2]}" -ge 90 ] || die "parent version for major release must have a micro version larger than ${VERSION_ARR[0]}.90 but current version is $VERSION_STR"
        [ "$CUR_BRANCH" == "nm-${VERSION_ARR[0]}-$((${VERSION_ARR[1]} + 1))" ] || die "major release can only be on \"nm-${VERSION_ARR[0]}-$((${VERSION_ARR[1]} + 1))\" branch"
Thomas Haller's avatar
Thomas Haller committed
247
        ;;
248
249
250
251
252
    major-post)
        number_is_odd "${VERSION_ARR[1]}" || die "cannot do major-post release on top of version $VERSION_STR"
        [ "$((${VERSION_ARR[2]} + 1))" -lt 90 ] || die "major-post release must have a micro version smaller than 90 but current version is $VERSION_STR"
        [ "$CUR_BRANCH" == master ] || die "major-post release can only be on master"
        ;;
Thomas Haller's avatar
Thomas Haller committed
253
254
255
256
257
258
259
    *)
        die "Release mode $RELEASE_MODE not yet implemented"
        ;;
esac

git fetch || die "git fetch failed"

260
261
if [ "$ALLOW_LOCAL_BRANCHES" != 1 ]; then
    git_same_ref "$CUR_BRANCH" "refs/heads/$CUR_BRANCH" || die "Current branch $CUR_BRANCH is not a branch??"
262
    git_same_ref "$CUR_BRANCH" "refs/remotes/$ORIGIN/$CUR_BRANCH" || die "Current branch $CUR_BRANCH seems not up to date with refs/remotes/$ORIGIN/$CUR_BRANCH. Git pull?"
263
fi
Thomas Haller's avatar
Thomas Haller committed
264
265
266
267
268
269
270
271
272
273
274

NEWER_BRANCHES=()
if [ "$CUR_BRANCH" != master ]; then
    i="${VERSION_ARR[1]}"
    while : ; do
        i=$((i + 2))
        b="nm-${VERSION_ARR[0]}-$i"
        if ! git show-ref --verify --quiet "refs/remotes/$ORIGIN/$b"; then
            git show-ref --verify --quiet "refs/heads/$b" && die "unexpectedly branch $b exists"
            break
        fi
275
276
        if [ "$ALLOW_LOCAL_BRANCHES" != 1 ]; then
            git_same_ref "$b" "refs/heads/$b" || die "branch $b is not a branch??"
277
            git_same_ref "$b" "refs/remotes/$ORIGIN/$b" || die "branch $b seems not up to date with refs/remotes/$ORIGIN/$b. Git pull?"
278
        fi
Thomas Haller's avatar
Thomas Haller committed
279
280
281
        NEWER_BRANCHES+=("refs/heads/$b")
    done
    b=master
282
283
    if [ "$ALLOW_LOCAL_BRANCHES" != 1 ]; then
        git_same_ref "$b" "refs/heads/$b" || die "branch $b is not a branch??"
284
        git_same_ref "$b" "refs/remotes/$ORIGIN/$b" || die "branch $b seems not up to date with refs/remotes/$ORIGIN/$b. Git pull?"
285
    fi
Thomas Haller's avatar
Thomas Haller committed
286
287
fi

288
289
290
291
if [ "$ALLOW_LOCAL_BRANCHES" != 1 ]; then
    cmp <(git show origin/master:contrib/fedora/rpm/release.sh) "$BASH_SOURCE" || die "$BASH_SOURCE is not identical to \`git show origin/master:contrib/fedora/rpm/release.sh\`"
fi

Thomas Haller's avatar
Thomas Haller committed
292
if [ $FIND_BACKPORTS = 1 ]; then
293
294
295
    git show "$ORIGIN/automation:contrib/rh-utils/find-backports" > ./.git/nm-find-backports \
    && chmod +x ./.git/nm-find-backports \
    || die "cannot get contrib/rh-utils/find-backports"
Thomas Haller's avatar
Thomas Haller committed
296

297
298
    TMP="$(./.git/nm-find-backports "$CUR_BRANCH" master "${NEWER_BRANCHES[@]}" 2>/dev/null)" || die "nm-find-backports failed"
    test -z "$TMP" || die "nm-find-backports returned patches that need to be backported (ignore with --no-find-backports): ./.git/nm-find-backports \"$CUR_BRANCH\" master ${NEWER_BRANCHES[@]}"
Thomas Haller's avatar
Thomas Haller committed
299
300
301
302
303
304
305
fi

TAGS=()
BUILD_TAG=

CLEANUP_CHECKOUT_BRANCH="$CUR_BRANCH"

306
307
git checkout -B "$TMP_BRANCH"
CLEANUP_REFS+=("refs/heads/$TMP_BRANCH")
308

Thomas Haller's avatar
Thomas Haller committed
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
case "$RELEASE_MODE" in
    minor)
        set_version_number "${VERSION_ARR[0]}" "${VERSION_ARR[1]}" $(("${VERSION_ARR[2]}" + 1))
        git commit -m "release: bump version to ${VERSION_ARR[0]}.${VERSION_ARR[1]}.$(("${VERSION_ARR[2]}" + 1))" -a || die "failed to commit release"
        set_version_number "${VERSION_ARR[0]}" "${VERSION_ARR[1]}" $(("${VERSION_ARR[2]}" + 2))
        git commit -m "release: bump version to ${VERSION_ARR[0]}.${VERSION_ARR[1]}.$(("${VERSION_ARR[2]}" + 2)) (development)" -a || die "failed to commit devel version bump"

        b="${VERSION_ARR[0]}.${VERSION_ARR[1]}.$(("${VERSION_ARR[2]}" + 1))"
        git tag -s -a -m "Tag $b" "$b" HEAD~ || die "failed to tag release"
        TAGS+=("$b")
        CLEANUP_REFS+=("refs/tags/$b")
        BUILD_TAG="$b"
        b="${VERSION_ARR[0]}.${VERSION_ARR[1]}.$(("${VERSION_ARR[2]}" + 2))"
        git tag -s -a -m "Tag $b (development)" "$b-dev" HEAD || die "failed to tag devel version"
        TAGS+=("$b-dev")
        CLEANUP_REFS+=("refs/tags/$b-dev")
325
        TAR_VERSION="$BUILD_TAG"
Thomas Haller's avatar
Thomas Haller committed
326
327
328
329
330
331
332
333
334
335
        ;;
    devel)
        set_version_number "${VERSION_ARR[0]}" "${VERSION_ARR[1]}" $(("${VERSION_ARR[2]}" + 1))
        git commit -m "release: bump version to ${VERSION_ARR[0]}.${VERSION_ARR[1]}.$(("${VERSION_ARR[2]}" + 1)) (development)" -a || die "failed to commit devel version bump"

        b="${VERSION_ARR[0]}.${VERSION_ARR[1]}.$(("${VERSION_ARR[2]}" + 1))"
        git tag -s -a -m "Tag $b (development)" "$b-dev" HEAD || die "failed to tag release"
        TAGS+=("$b-dev")
        CLEANUP_REFS+=("refs/tags/$b-dev")
        BUILD_TAG="$b-dev"
336
        TAR_VERSION="$b"
Thomas Haller's avatar
Thomas Haller committed
337
        ;;
338
339
340
341
342
343
344
345
346
347
    rc)
        b="${VERSION_ARR[0]}.${VERSION_ARR[1]}.$(("${VERSION_ARR[2]}" + 1))"
        t="${VERSION_ARR[0]}.$(("${VERSION_ARR[1]}" + 1))-rc$RC_VERSION"
        set_version_number "${VERSION_ARR[0]}" "${VERSION_ARR[1]}" $(("${VERSION_ARR[2]}" + 1))
        git commit -m "release: bump version to $b ($t) (development)" -a || die "failed to commit rc version bump"

        git tag -s -a -m "Tag $b ($t) (development)" "$t" HEAD || die "failed to tag release"
        TAGS+=("$t")
        CLEANUP_REFS+=("refs/tags/$t")
        BUILD_TAG="$t"
348
        TAR_VERSION="$b"
349
        ;;
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
    major)
        b="${VERSION_ARR[0]}.$((${VERSION_ARR[1]} + 1)).0"
        b2="${VERSION_ARR[0]}.$((${VERSION_ARR[1]} + 1)).1"

        set_version_number "${VERSION_ARR[0]}" "$((${VERSION_ARR[1]} + 1))" 0
        git commit -m "release: bump version to $b" -a || die "failed to commit major version bump"
        git tag -s -a -m "Tag $b" "$b" HEAD || die "failed to tag release"
        TAGS+=("$b")
        CLEANUP_REFS+=("refs/tags/$b")

        set_version_number "${VERSION_ARR[0]}" "$((${VERSION_ARR[1]} + 1))" 1
        git commit -m "release: bump version to $b2 (development)" -a || die "failed to commit another bump after major version bump"
        git tag -s -a -m "Tag $b (development)" "$b2-dev" HEAD || die "failed to tag release"
        TAGS+=("$b2-dev")
        CLEANUP_REFS+=("refs/tags/$b2-dev")

        BUILD_TAG="$b"
        TAR_VERSION="$b"
        ;;
369
    major-post)
370
371
372
373
374
        # We create a merge commit with the content of current "master", with two
        # parent commits $THE_RELEASE and "master". But we want that the first parent
        # is the release, so that `git log --first-parent` follows the path with the
        # release candidates, and not the devel part during that time. Hence this
        # switcheroo here.
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
        git checkout -B "$TMP_BRANCH" "${VERSION_ARR[0]}.$((${VERSION_ARR[1]} - 1)).0" || die "merge0"
        git merge -Xours --commit -m tmp master || die "merge1"
        git rm --cached -r . || die "merge2"
        git checkout master -- . || die "merge3"
        b="${VERSION_ARR[0]}.${VERSION_ARR[1]}.$((${VERSION_ARR[2]} + 1))"
        git commit --amend -m tmp -a || die "failed to commit major version bump"
        test x = "x$(git diff master HEAD)" || die "there is a diff after merge!"

        set_version_number "${VERSION_ARR[0]}" "${VERSION_ARR[1]}" "$((${VERSION_ARR[2]} + 1))"
        git commit --amend -m "release: bump version to $b (development)" -a || die "failed to commit major version bump"
        git tag -s -a -m "Tag $b (development)" "$b-dev" HEAD || die "failed to tag release"
        TAGS+=("$b-dev")
        CLEANUP_REFS+=("refs/tags/$b-dev")
        BUILD_TAG="$b-dev"
        TAR_VERSION="$b"
        ;;
Thomas Haller's avatar
Thomas Haller committed
391
392
393
394
395
396
397
398
399
400
401
402
    *)
        die "Release mode $RELEASE_MODE not yet implemented"
        ;;
esac

RELEASE_FILE=

if [ -n "$BUILD_TAG" ]; then
    git checkout "$BUILD_TAG" || die "failed to checkout $BUILD_TAG"

    ./contrib/fedora/rpm/build_clean.sh -r || die "build release failed"

403
    RELEASE_FILE="NetworkManager-$TAR_VERSION.tar.xz"
Thomas Haller's avatar
Thomas Haller committed
404

405
406
407
408
409
410
411
    test -f "./$RELEASE_FILE" \
    && test -f "./$RELEASE_FILE.sig" \
    || die "release file \"./$RELEASE_FILE\" not found"

    cp "./$RELEASE_FILE" "./$RELEASE_FILE.sig" /tmp || die "failed to copy release tarball to /tmp"

    git clean -fdx
Thomas Haller's avatar
Thomas Haller committed
412
413
414
fi

if [ -n "$RELEASE_FILE" ]; then
415
    do_command rsync -va --append-verify -P "/tmp/$RELEASE_FILE" master.gnome.org: || die "failed to rsync \"/tmp/$RELEASE_FILE\""
416
    do_command ssh master.gnome.org ftpadmin install --unattended "$RELEASE_FILE" || die "ftpadmin install failed"
Thomas Haller's avatar
Thomas Haller committed
417
418
fi

419
git checkout -B "$CUR_BRANCH" "$TMP_BRANCH" || die "cannot checkout $CUR_BRANCH"
Thomas Haller's avatar
Thomas Haller committed
420

421
do_command git push "$ORIGIN" "${TAGS[@]}" "$CUR_BRANCH"
Thomas Haller's avatar
Thomas Haller committed
422

423
if [ "$DRY_RUN" = 0 ]; then
Thomas Haller's avatar
Thomas Haller committed
424
425
426
    CLEANUP_REFS=()
    CLEANUP_CHECKOUT_BRANCH=
fi