Skip to content

Commit b111a81

Browse files
shivaramrxin
authored andcommitted
[SPARK-17651][SPARKR] Set R package version number along with mvn
This PR sets the R package version while tagging releases. Note that since R doesn't accept `-SNAPSHOT` in version number field, we remove that while setting the next version Tested manually by running locally Author: Shivaram Venkataraman <[email protected]> Closes #15223 from shivaram/sparkr-version-change. (cherry picked from commit 7c38252) Signed-off-by: Reynold Xin <[email protected]>
1 parent 452e468 commit b111a81

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

dev/create-release/release-tag.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,27 @@ git config user.email $GIT_EMAIL
6060

6161
# Create release version
6262
$MVN versions:set -DnewVersion=$RELEASE_VERSION | grep -v "no value" # silence logs
63+
# Set the release version in R/pkg/DESCRIPTION
64+
sed -i".tmp1" 's/Version.*$/Version: '"$RELEASE_VERSION"'/g' R/pkg/DESCRIPTION
65+
# Set the release version in docs
66+
sed -i".tmp1" 's/SPARK_VERSION:.*$/SPARK_VERSION: '"$RELEASE_VERSION"'/g' docs/_config.yml
67+
sed -i".tmp2" 's/SPARK_VERSION_SHORT:.*$/SPARK_VERSION_SHORT: '"$RELEASE_VERSION"'/g' docs/_config.yml
68+
6369
git commit -a -m "Preparing Spark release $RELEASE_TAG"
6470
echo "Creating tag $RELEASE_TAG at the head of $GIT_BRANCH"
6571
git tag $RELEASE_TAG
6672

6773
# Create next version
6874
$MVN versions:set -DnewVersion=$NEXT_VERSION | grep -v "no value" # silence logs
75+
# Remove -SNAPSHOT before setting the R version as R expects version strings to only have numbers
76+
R_NEXT_VERSION=`echo $NEXT_VERSION | sed 's/-SNAPSHOT//g'`
77+
sed -i".tmp2" 's/Version.*$/Version: '"$R_NEXT_VERSION"'/g' R/pkg/DESCRIPTION
78+
79+
# Update docs with next version
80+
sed -i".tmp3" 's/SPARK_VERSION:.*$/SPARK_VERSION: '"$NEXT_VERSION"'/g' docs/_config.yml
81+
# Use R version for short version
82+
sed -i".tmp4" 's/SPARK_VERSION_SHORT:.*$/SPARK_VERSION_SHORT: '"$R_NEXT_VERSION"'/g' docs/_config.yml
83+
6984
git commit -a -m "Preparing development version $NEXT_VERSION"
7085

7186
# Push changes

0 commit comments

Comments
 (0)