Skip to content

Commit

Permalink
Merge pull request #355 from zalando/support-release-notes
Browse files Browse the repository at this point in the history
Allow to provide release notes, do not commit versions changes
  • Loading branch information
cberg-zalando authored Apr 20, 2023
2 parents f80c2f8 + 794eb54 commit c30b65d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 15 deletions.
2 changes: 2 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ tasks {
}
patchPluginXml {
untilBuild.set("") // null will add until-build to the plugin.xml
version.set(project.findProperty("version")?.toString() ?: "DEV")
changeNotes.set(project.findProperty("changeNotes")?.toString() ?: "none")
}
}

Expand Down
23 changes: 9 additions & 14 deletions release.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#!/usr/bin/env bash
set -euo pipefail

if [[ "$#" -lt 2 || -z "${1}" || -z "${2}" ]]
DEFAULT_BRANCH="master"

if [[ "$#" -lt 3 || -z "${1}" || -z "${2}" || -z "${3}" ]]
then
echo "Version and release channel need to be provided."
echo "Usage: ./release.sh <version> <release-channel>"
echo "Version, release channel and release notes need to be provided."
echo "Usage: ./release.sh <version> <release-channel> <release-notes>"
exit 1
fi

Expand All @@ -28,17 +30,10 @@ if [[ -z "${JETBRAINS_HUB_TOKEN:-}" ]]
exit 1
fi

NEW_VERSION=$1

if [[ "$(uname)" == "Darwin" ]]
if [[ "$(git branch --show-current)" != "${DEFAULT_BRANCH}" ]]
then
SED_ARG=(-i "")
else
SED_ARG=(-i)
echo "Please use ${DEFAULT_BRANCH} branch"
exit 1
fi
sed "${SED_ARG[@]}" "s/<version>.*<\/version>/<version>$NEW_VERSION<\/version>/g" src/main/resources/META-INF/plugin.xml
git checkout master
./gradlew publishPlugin -Pversion="${NEW_VERSION}" -PjetbrainsReleaseChannel="${2}" -x buildSearchableOptions
git add src/main/resources/META-INF/plugin.xml
git commit -m "Bump version"

./gradlew publishPlugin -Pversion="${1}" -PjetbrainsReleaseChannel="${2}" -PchangeNotes="${3}" -x buildSearchableOptions
2 changes: 1 addition & 1 deletion src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<idea-plugin>
<id>org.zalando.intellij.swagger</id>
<name>Swagger</name>
<version>1.1.2</version>
<version>DEV</version>
<vendor email="[email protected]" url="https://tech.zalando.com/">Zalando SE</vendor>

<depends>com.intellij.modules.lang</depends>
Expand Down

0 comments on commit c30b65d

Please sign in to comment.