-
Notifications
You must be signed in to change notification settings - Fork 75
/
release.sh
executable file
·42 lines (34 loc) · 1.04 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
#!/usr/bin/env bash
set -euo pipefail
DEFAULT_BRANCH="master"
if [[ "$#" -lt 3 || -z "${1}" || -z "${2}" || -z "${3}" ]]
then
echo "Version, release channel and release notes need to be provided."
echo "Usage: ./release.sh <version> <release-channel> <release-notes>"
exit 1
fi
if [[ "${2}" != "stable" && "${2}" != "beta" ]]
then
echo "Unsupported release channel ${2} - supported values: stable, beta."
echo "Usage: ./release.sh <version> <release-channel>"
exit 1
fi
ENVS=$(grep -v '^\#' .env || true)
if [[ -n "${ENVS}" ]]
then
export "${ENVS?}"
fi
if [[ -z "${JETBRAINS_HUB_TOKEN:-}" ]]
then
echo "Please put JETBRAINS_HUB_TOKEN in .env: JETBRAINS_HUB_TOKEN=<token>"
exit 1
fi
if [[ "$(git branch --show-current)" != "${DEFAULT_BRANCH}" ]]
then
echo "Please use ${DEFAULT_BRANCH} branch"
exit 1
fi
./gradlew publishPlugin -Pversion="${1}" -PjetbrainsReleaseChannel="${2}" -PchangeNotes="${3}" -x buildSearchableOptions
TAG="v${1}"
git tag -a "${TAG}" -m "Release ${1}"
git push origin "${TAG}"