forked from VSCodium/vscodium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheck_tags.sh
executable file
·89 lines (86 loc) · 3.71 KB
/
check_tags.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#!/bin/bash
REPOSITORY=${TRAVIS_REPO_SLUG:-"VSCodium/vscodium"}
GITHUB_RESPONSE=$(curl -s -H "Authorization: token $GITHUB_TOKEN" https://api.github.com/repos/$REPOSITORY/releases/tags/$LATEST_MS_TAG)
echo "Github response: ${GITHUB_RESPONSE}"
VSCODIUM_ASSETS=$(echo $GITHUB_RESPONSE | jq '.assets')
echo "VSCodium assets: ${VSCODIUM_ASSETS}"
# if we just don't have the github token, get out fast
if [ "$GITHUB_TOKEN" != "" ]; then
if [ "$VSCODIUM_ASSETS" != "null" ]; then
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
HAVE_MAC=$(echo $VSCODIUM_ASSETS | jq 'map(.name) | contains(["zip"])')
if [[ "$HAVE_MAC" != "true" ]]; then
echo "Building on Mac because we have no ZIP"
export SHOULD_BUILD="yes"
fi
elif [[ $BUILDARCH == "ia32" ]]; then
HAVE_IA32_RPM=$(echo $VSCODIUM_ASSETS | jq 'map(.name) | contains(["i386.rpm"])')
HAVE_IA32_DEB=$(echo $VSCODIUM_ASSETS | jq 'map(.name) | contains(["i386.deb"])')
HAVE_IA32_TAR=$(echo $VSCODIUM_ASSETS | jq --arg suffix "ia32-$LATEST_MS_TAG.tar.gz" 'map(.name) | contains([$suffix])')
if [[ "$HAVE_IA32_RPM" != "true" ]]; then
echo "Building on Linux ia32 because we have no RPM"
export SHOULD_BUILD="yes"
fi
if [[ "$HAVE_IA32_DEB" != "true" ]]; then
echo "Building on Linux ia32 because we have no DEB"
export SHOULD_BUILD="yes"
fi
if [[ "$HAVE_IA32_TAR" != "true" ]]; then
echo "Building on Linux ia32 because we have no TAR"
export SHOULD_BUILD="yes"
fi
if [[ "$SHOULD_BUILD" != "yes" ]]; then
echo "Already have all the Linux ia32 builds"
fi
elif [[ $BUILDARCH == "arm64" ]]; then
# HAVE_ARM64_RPM=$(echo $VSCODIUM_ASSETS | jq 'map(.name) | contains(["arm64.rpm"])')
HAVE_ARM64_DEB=$(echo $VSCODIUM_ASSETS | jq 'map(.name) | contains(["arm64.deb"])')
HAVE_ARM64_TAR=$(echo $VSCODIUM_ASSETS | jq --arg suffix "arm64-$LATEST_MS_TAG.tar.gz" 'map(.name) | contains([$suffix])')
# if [[ "$HAVE_ARM64_RPM" != "true" ]]; then
# echo "Building on Linux arm64 because we have no RPM"
# export SHOULD_BUILD="yes"
# fi
if [[ "$HAVE_ARM64_DEB" != "true" ]]; then
echo "Building on Linux arm64 because we have no DEB"
export SHOULD_BUILD="yes"
fi
if [[ "$HAVE_ARM64_TAR" != "true" ]]; then
echo "Building on Linux arm64 because we have no TAR"
export SHOULD_BUILD="yes"
fi
if [[ "$SHOULD_BUILD" != "yes" ]]; then
echo "Already have all the Linux arm64 builds"
fi
else
HAVE_64_RPM=$(echo $VSCODIUM_ASSETS | jq 'map(.name) | contains(["x86_64.rpm"])')
HAVE_64_DEB=$(echo $VSCODIUM_ASSETS | jq 'map(.name) | contains(["amd64.deb"])')
HAVE_64_TAR=$(echo $VSCODIUM_ASSETS | jq --arg suffix "x64-$LATEST_MS_TAG.tar.gz" 'map(.name) | contains([$suffix])')
if [[ "$HAVE_64_RPM" != "true" ]]; then
echo "Building on Linux x64 because we have no RPM"
export SHOULD_BUILD="yes"
fi
if [[ "$HAVE_64_DEB" != "true" ]]; then
echo "Building on Linux x64 because we have no DEB"
export SHOULD_BUILD="yes"
fi
if [[ "$HAVE_64_TAR" != "true" ]]; then
echo "Building on Linux x64 because we have no TAR"
export SHOULD_BUILD="yes"
fi
if [[ "$SHOULD_BUILD" != "yes" ]]; then
echo "Already have all the Linux x64 builds"
fi
fi
else
echo "Release assets do not exist at all, continuing build"
export SHOULD_BUILD="yes"
fi
if git rev-parse $LATEST_MS_TAG >/dev/null 2>&1
then
export TRAVIS_TAG=$LATEST_MS_TAG
else
git config --local user.name "Travis CI"
git config --local user.email "[email protected]"
git tag $LATEST_MS_TAG
fi
fi