-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_release.sh
More file actions
executable file
·41 lines (29 loc) · 923 Bytes
/
build_release.sh
File metadata and controls
executable file
·41 lines (29 loc) · 923 Bytes
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
#!/usr/bin/env bash
# ex: set tabstop=8 softtabstop=0 expandtab shiftwidth=2 smarttab:
set -eu
SNAPCRAFT_BIN="${SNAPCRAFT:-snap run snapcraft}"
EXPORT_LOGIN="${EXPORT_LOGIN:-}"
if ! snap list snapcraft > /dev/null 2> /dev/null; then
sudo snap install --candidate --classic snapcraft
fi
if ! ${SNAPCRAFT_BIN} whoami; then
if [ -n "${EXPORT_LOGIN}" ]; then
${SNAPCRAFT_BIN} login --with - <<<${EXPORT_LOGIN}
else
echo "You need you set the EXPORT_LOGIN variable"
exit 1
fi
fi
${SNAPCRAFT_BIN} remote-build --launchpad-accept-public-upload
git_branch="$(sed 's|^.*/||' .git/HEAD)"
if [ "${git_branch}" == 'master' ]; then
release_channel="stable"
elif [ "${git_branch}" == 'dev' ]; then
release_channel="candidate,beta,edge"
else
echo "There is no release channel for this branch"
exit 0
fi
for snap in *.snap; do
${SNAPCRAFT_BIN} upload "${snap}" --release "${release_channel}"
done