2 Star 1 Fork 0

lee/rl4j

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
perform-release.sh 2.02 KB
一键复制 编辑 原始数据 按行查看 历史
Samuel Audet 提交于 2017-12-12 15:32 . Update repository profiles
#!/bin/bash
set -eu
if [[ $# < 2 ]]; then
echo "Usage: bash perform-release.sh release_version snapshot_version [staging_repository]"
exit 1
fi
RELEASE_VERSION=$1
SNAPSHOT_VERSION=$2
STAGING_REPOSITORY=${3:-}
SKIP_BUILD=${SKIP_BUILD:-0}
RELEASE_PROFILE=${RELEASE_PROFILE:-sonatype}
echo "Releasing version $RELEASE_VERSION ($SNAPSHOT_VERSION) to repository $RELEASE_PROFILE $STAGING_REPOSITORY"
echo "========================================================================================================="
if [[ ! -z $(git tag -l "rl4j-$RELEASE_VERSION") ]]; then
echo "Error: Version $RELEASE_VERSION has already been released!"
exit 1
fi
sed -i "s/<nd4j.version>.*<\/nd4j.version>/<nd4j.version>$RELEASE_VERSION<\/nd4j.version>/" pom.xml
sed -i "s/<datavec.version>.*<\/datavec.version>/<datavec.version>$RELEASE_VERSION<\/datavec.version>/" pom.xml
sed -i "s/<dl4j.version>.*<\/dl4j.version>/<dl4j.version>$RELEASE_VERSION<\/dl4j.version>/" pom.xml
mvn versions:set -DallowSnapshots=true -DgenerateBackupPoms=false -DnewVersion=$RELEASE_VERSION
if [[ "${SKIP_BUILD}" == "0" ]]; then
mvn clean deploy -Dgpg.executable=gpg2 -DperformRelease -Dlocal.software.repository=$RELEASE_PROFILE -Dmaven.test.skip -DstagingRepositoryId=$STAGING_REPOSITORY
fi
git commit -s -a -m "Update to version $RELEASE_VERSION"
git tag -s -a -m "rl4j-$RELEASE_VERSION" "rl4j-$RELEASE_VERSION"
git tag -s -a -f -m "rl4j-$RELEASE_VERSION" "latest_release"
sed -i "s/<nd4j.version>.*<\/nd4j.version>/<nd4j.version>$SNAPSHOT_VERSION<\/nd4j.version>/" pom.xml
sed -i "s/<datavec.version>.*<\/datavec.version>/<datavec.version>$SNAPSHOT_VERSION<\/datavec.version>/" pom.xml
sed -i "s/<dl4j.version>.*<\/dl4j.version>/<dl4j.version>$SNAPSHOT_VERSION<\/dl4j.version>/" pom.xml
mvn versions:set -DallowSnapshots=true -DgenerateBackupPoms=false -DnewVersion=$SNAPSHOT_VERSION
git commit -s -a -m "Update to version $SNAPSHOT_VERSION"
echo "Successfully performed release of version $RELEASE_VERSION ($SNAPSHOT_VERSION) to repository $RELEASE_PROFILE $STAGING_REPOSITORY"
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/sleechengn/rl4j.git
git@gitee.com:sleechengn/rl4j.git
sleechengn
rl4j
rl4j
master

搜索帮助