-
Notifications
You must be signed in to change notification settings - Fork 1
/
release.sh
executable file
·74 lines (59 loc) · 1.57 KB
/
release.sh
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
#!/bin/bash
set -e
if [ -z "${TAG_NAME}" ]; then
echo "TAG_NAME not set"
exit 1
fi
artifact_path="dist/release"
artifacts=$(find ${artifact_path}/* -exec basename {} \;)
echo "Releasing with:"
for artifact in ${artifacts}; do echo "- ${artifact}"; done
curl -L https://github.com/github-release/github-release/releases/download/v0.8.1/linux-amd64-github-release.bz2 > ./github-release.bz2
bunzip2 -f ./github-release.bz2
chmod +x ./github-release
if [[ "${TAG_NAME}" == *-* ]] ; then
releaseopt="--pre-release"
else
releaseopt=""
fi
echo "Creating release named ${TAG_NAME} in MCC repo"
./github-release release \
$releaseopt \
--user Mirantis \
--repo mcc \
--tag "${TAG_NAME}" \
--name "${TAG_NAME}"
sleep 10
echo "Uploading the artifacts to ${TAG_NAME} in MCC repo"
for artifact in ${artifacts}
do
./github-release upload \
--user Mirantis \
--repo mcc \
--tag "${TAG_NAME}" \
--name "${artifact}" \
--file "${artifact_path}/${artifact}"
done
if [ -z "$releaseopt" ]; then
echo "Creating release named ${TAG_NAME} in Launchpad repo"
# Release to the public repo
./github-release release \
$releaseopt \
--draft \
--user Mirantis \
--repo launchpad \
--tag "${TAG_NAME}" \
--name "${TAG_NAME}"
sleep 10
echo "Uploading the artifacts to ${TAG_NAME} in Launchpad repo"
for artifact in ${artifacts}
do
./github-release upload \
--user Mirantis \
--repo launchpad \
--tag "${TAG_NAME}" \
--name "${artifact}" \
--file "${artifact_path}/${artifact}"
done
fi
rm ./github-release