Skip to content

Commit

Permalink
Create a release script
Browse files Browse the repository at this point in the history
  • Loading branch information
alban-auzeill committed Oct 26, 2020
1 parent d853b8e commit 2b7e43d
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
6 changes: 5 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ plugins {
}

group 'org.example'
version '1.1-SNAPSHOT'
project.version '1.1-SNAPSHOT'

if (project.hasProperty('releaseVersion')) {
project.version = project.releaseVersion
}

repositories {
mavenCentral()
Expand Down
21 changes: 21 additions & 0 deletions release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bash
set -euo pipefail

do_release() {
export CURRENT_VERSION="$(sed -rn "s/^project\.version '([^']*)'$/\1/p" build.gradle)"
echo "current version: ${CURRENT_VERSION}"
export RELEASE_VERSION="${CURRENT_VERSION/-SNAPSHOT/}"
echo "release version: ${RELEASE_VERSION}"
(
graalvm
./gradlew --no-daemon "-PreleaseVersion=${RELEASE_VERSION}" clean build
native-image -jar "build/libs/compare-directory-${RELEASE_VERSION}.jar" build/compare-directory
echo "Binary file: build/compare-directory is ready to be downloaded on"
echo "https://github.com/alban-auzeill/compare-directory/releases"
echo "to create the release: v${RELEASE_VERSION}"
echo
echo "Then build.gradle need to be prepared for next release."
)
}

do_release

0 comments on commit 2b7e43d

Please sign in to comment.