0
Files
.github
.mvn
dev
checkstyle
README
before
before_install
docker.sh
dockerhub_readme.py
findbugs_filter.xml
get_upload_url.sh
install-bitkeeper.sh
install-python-packages.sh
install-universal_ctags.sh
javadoc.sh
main
parse.js
pmd_ruleset.xml
ref2tag.sh
release.sh
validate-xref
distribution
docker
opengrok-indexer
opengrok-web
plugins
suggester
tools
.gitattributes
.gitignore
CONTRIBUTING.md
Dockerfile
LICENSE-adaic.org.txt
LICENSE-eclipse.txt
LICENSE-ecma.txt
LICENSE-mandoc.txt
LICENSE-ruby.txt
LICENSE-scala.txt
LICENSE.txt
NOTICE.txt
README.md
SECURITY.md
apiary.apib
logging.properties
mvnw
mvnw.cmd
pom.xml
sonar-project.properties
2024-08-01 11:31:55 +02:00

54 lines
1.2 KiB
Bash
Executable File

#!/bin/bash
#
# Query current release or trigger new release creation on Github.
# For the latter, it merely kick-starts the creation of new Release on Github,
# see https://github.com/oracle/opengrok/wiki/Release-process
#
# Assumes working Maven + Git.
#
set -e
if (( $# > 1 )); then
echo "usage: `basename $0` [version]"
exit 1
fi
# Get the latest version (needs curl + jq).
if (( $# == 0 )); then
curl -s https://api.github.com/repos/oracle/opengrok/releases/latest | \
jq .tag_name
exit 0
fi
VERSION=$1
if ! echo "$VERSION" | grep '^[0-9]\+\.[0-9]\+\.[0-9]\+$' >/dev/null; then
echo "version needs to be in the form of <num>.<num>.<num>"
exit 1
fi
if [[ ! -d $PWD/opengrok-indexer ]]; then
echo "This needs to be run from top-level directory of the repository"
exit 1
fi
ver=$( git tag -l "$VERSION" )
if (( $? != 0 )); then
echo "Cannot determine tag"
exit 1
fi
if [[ $ver == $VERSION ]]; then
echo "Tag $VERSION already exists"
exit 1
fi
git pull --ff-only
git switch -c "release_${VERSION}"
./mvnw versions:set -DgenerateBackupPoms=false "-DnewVersion=$VERSION"
git commit pom.xml '**/pom.xml' -m "$VERSION"
git push
echo
echo "Create PR with the changes. Once it is merged in, create new release."
echo