File: release

package info (click to toggle)
gnome-disk-utility 46.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 15,344 kB
  • sloc: ansic: 20,447; xml: 240; sh: 93; makefile: 9
file content (101 lines) | stat: -rwxr-xr-x 3,256 bytes parent folder | download
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#!/bin/bash
set -euo pipefail

DRY="${DRY:-0}"
KEYNAME="${KEYNAME:-id_gnome}"
GNOMEUSERNAME="${GNOMEUSERNAME:-kailueke}"
KEY="${HOME}/.ssh/${KEYNAME}"

ARG="${1-}"
if [ "${ARG}" = "" ] || [ "${ARG}" = "-h" ] || [ "${ARG}" = "--help" ]; then
  echo "Usage: [GNOMEUSERNAME=mygnomeuser] [KEYNAME=id_rsa] [DRY=1] $0 VERSION"
  echo "Pulls the current branch, generates the NEWS entries, bumps meson version,"
  echo "then tags and pushes the commit and uploads the tar ball"
  exit 1
fi

if ! echo "${ARG}" | grep "\." -q; then
  echo "No minor version given"
  exit 1
fi
MAJOR=$(echo "${ARG}" | cut -d . -f 1)
MINOR=$(echo "${ARG}" | cut -d . -f 2)
if [ "${MAJOR}" = "" ] || [ "${MINOR}" = "" ]; then
  echo "Major '${MAJOR}' or minor '${MINOR}' version empty"
  exit 1
fi
BRANCH=$(git rev-parse --abbrev-ref HEAD)
if [ "${BRANCH}" != "main" ] && [ "${BRANCH}" != "gnome-${MAJOR}" ]; then
  echo "Branch ${BRANCH} does not match the expected 'main' or 'gnome-${MAJOR}' branch"
  exit 1
fi

REMOTE=$(git remote -v | grep "ssh://git@gitlab.gnome.org" | grep -m 1 push | cut -f 1)

git pull "${REMOTE}" "${BRANCH}"

LAST_TAG=$(git describe --tags --abbrev=0)
if [ "${LAST_TAG}" = "${ARG}" ]; then
  echo "Last tag is ${ARG}"
  exit 1
fi

{
  DATE=$(LC_ALL=C date '+%B %d, %Y')
  HEADER="${ARG} - ${DATE}"
  echo "${HEADER}"
  echo "${HEADER}" | tr '[:print:]' '='
  echo
  git shortlog "${LAST_TAG}..HEAD" -- ':!po/*.po' ':!release' | sed 's/ ([0-9]*):$/:/' | sed 's/^ [ ]*/ \* /'
  if [ "$(git log "${LAST_TAG}..HEAD"   -- po/*.po)" != "" ]; then
    echo "Updated translations:"
    {
      echo -n ' * '
      git log "${LAST_TAG}..HEAD" --pretty=format:%an --name-only  -- po/*.po | sed -e :a -e '$!N;s|\npo/\(.*\)\.po| \(\1\)|;ta' | sort -u | sed '$!N;s/^\n//' | python3 -c 'print(", ".join(open("/dev/stdin").read().strip().split("\n")))'
    } | fold -s -w 75 | sed -e '2,$s/^/   /' | sed -e 's/[[:space:]]*$//'
    echo
  fi
} | {
  if [ "${DRY}" = "0" ]; then
    cat - NEWS | sponge NEWS
  else
    cat
  fi
}

if [ "${DRY}" = "0" ]; then
  SEDARG="-i"
  PASS="meson.build"
else
  SEDARG=""
  PASS="-"
fi
echo "Meson version:"
sed ${SEDARG} -e "3,\$s/^  version: '${LAST_TAG}',\$/  version: '${ARG}',/" meson.build | grep -m 1 version "${PASS}"
if [ "${DRY}" = "0" ]; then
  PASS="data/org.gnome.DiskUtility.appdata.xml.in"
else
  PASS="-"
fi
echo "Appdata URLs:"
sed ${SEDARG} -e "s,/raw/[^/]*,/raw/${BRANCH},g" data/org.gnome.DiskUtility.appdata.xml.in | grep raw/ "${PASS}"

if [ "${DRY}" = "0" ]; then
  git add NEWS meson.build data/org.gnome.DiskUtility.appdata.xml.in
  git commit -m "Prepare ${ARG}"
  git tag -a -m "GNOME Disks ${ARG}" "${ARG}"
  rm -r builddir
  meson builddir
  ninja -C builddir dist
  git push "${REMOTE}"
  git push "${REMOTE}" "${ARG}"
  scp -i "${KEY}" "${PWD}/builddir/meson-dist/gnome-disk-utility-${ARG}.tar.xz"  "${GNOMEUSERNAME}@master.gnome.org:"
  ssh -t -i "${KEY}" "${GNOMEUSERNAME}@master.gnome.org" ftpadmin install "gnome-disk-utility-${ARG}.tar.xz"
  echo "Success"
else
  echo "GNOME Disks ${ARG} (dry run)"
fi
if [ "${MINOR}" = "0" ]; then
  echo "If this is a stable release, create the branch:"
  echo "git branch gnome-${MAJOR} && git checkout gnome-${MAJOR} && git push ${REMOTE} && echo Success"
fi