Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[486] Add release guide for XTable #434

Merged
merged 1 commit into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@
<artifactId>xtable</artifactId>
<name>xtable</name>
<inceptionYear>2024</inceptionYear>
<version>0.1.0-SNAPSHOT</version>
<packaging>pom</packaging>

<parent>
<groupId>org.apache</groupId>
<artifactId>apache</artifactId>
<version>33</version>
</parent>

<version>0.1.0-SNAPSHOT</version>
<packaging>pom</packaging>

<modules>
<module>xtable-api</module>
<module>xtable-core</module>
Expand Down
478 changes: 478 additions & 0 deletions release/release_guide.md

Large diffs are not rendered by default.

74 changes: 74 additions & 0 deletions release/scripts/create_source_release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
#!/bin/bash
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
## Variables with defaults (if not overwritten by environment)
##
MVN=${MVN:-mvn}

# fail immediately
set -o errexit
set -o nounset
# print command before executing
set -o xtrace

CURR_DIR=`pwd`
if [[ `basename $CURR_DIR` != "release" ]] ; then
echo "You have to call the script from the release/ dir"
exit 1
fi

RELEASE_VERSION=`grep -A 5 "<artifactId>xtable</artifactId>" ../pom.xml | grep '<version>' | sed -e 's/<version>//' -e 's/<\/version>//' -e 's/ //g'`

if [ -z "${RELEASE_VERSION}" ]; then
echo "RELEASE_VERSION was not set."
exit 1
fi

echo "RELEASE_VERSION=${RELEASE_VERSION}"

###########################

cd ..

XTABLE_DIR=`pwd`
RELEASE_DIR=${XTABLE_DIR}/src_release
CLONE_DIR=${RELEASE_DIR}/incubator-xtable-tmp-clone
[email protected]:apache/incubator-xtable.git

echo "Creating source package"

rm -rf ${RELEASE_DIR}
mkdir -p ${RELEASE_DIR}

# create a temporary git clone to ensure that we have a pristine source release
git clone ${GITHUB_REPO_URL} ${CLONE_DIR}
cd ${CLONE_DIR}
git checkout release-${RELEASE_VERSION}-rc${RC_NUM}

rsync -a \
--exclude ".git" --exclude ".gitignore" --exclude ".gitattributes" --exclude ".travis.yml" \
--exclude ".github" --exclude "target" --exclude ".idea" --exclude "*.iml" --exclude ".DS_Store" \
--exclude "build-target" --exclude ".rubydeps" --exclude "rfc" --exclude "docker/images" \
--exclude "assets" --exclude "demo" --exclude "website" --exclude "style/IDE.png" . apache-xtable-$RELEASE_VERSION

tar czf ${RELEASE_DIR}/apache-xtable-${RELEASE_VERSION}.src.tgz apache-xtable-$RELEASE_VERSION
gpg --armor --local-user E391B3E8179C4FD9BB8BF72002AB8E945EFD1E91 --detach-sig ${RELEASE_DIR}/apache-xtable-${RELEASE_VERSION}.src.tgz
cd ${RELEASE_DIR}
shasum -a 512 apache-xtable-${RELEASE_VERSION}.src.tgz > apache-xtable-${RELEASE_VERSION}.src.tgz.sha512

cd ${CURR_DIR}
rm -rf ${CLONE_DIR}
140 changes: 140 additions & 0 deletions release/scripts/cut_release_branch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
#!/bin/bash
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
set -e

function clean_up(){
echo "Do you want to clean local clone repo? [y|N]"
read confirmation
if [[ $confirmation = "y" ]]; then
cd ~
rm -rf ${LOCAL_CLONE_DIR}
echo "Clean up local repo."
fi
}

if [[ $# -eq 1 && $1 = "-h" ]]; then
echo "This script will update apache incubator-xtable main branch with next release version and cut release branch for current development version."
echo "There are 3 params required:"
echo "--release=\${CURRENT_RELEASE_VERSION}"
echo "--next_release=\${NEXT_RELEASE_VERSION}"
echo "--rc_num=\${RC_NUM}"
exit
else
for param in "$@"
do
if [[ $param =~ --release\=([0-9]\.[0-9]*\.[0-9]-incubating) ]]; then
RELEASE=${BASH_REMATCH[1]}
fi
if [[ $param =~ --next_release\=([0-9]\.[0-9]*\.[0-9]) ]]; then
NEXT_VERSION_IN_BASE_BRANCH=${BASH_REMATCH[1]}
fi
if [[ $param =~ --rc_num\=([0-9]*) ]]; then
RC_NUM=${BASH_REMATCH[1]}
fi
done
fi

if [[ -z "$RELEASE" || -z "$NEXT_VERSION_IN_BASE_BRANCH" || -z "$RC_NUM" ]]; then
echo "This script needs to be ran with params, please run with -h to get more instructions."
exit
fi


MAIN_BRANCH=main
NEXT_VERSION_BRANCH=MINOR-move-to-${NEXT_VERSION_IN_BASE_BRANCH}
RELEASE_BRANCH=release-${RELEASE}-rc${RC_NUM}
[email protected]:apache/incubator-xtable.git
XTABLE_REPO_DIR=incubator-xtable
LOCAL_CLONE_DIR=incubator-xtable_release_${RELEASE}

echo "=====================Environment Variables====================="
echo "version: ${RELEASE}"
echo "next_release: ${NEXT_VERSION_IN_BASE_BRANCH}"
echo "working main branch: ${MAIN_BRANCH}"
echo "working next-version branch: ${NEXT_VERSION_BRANCH}"
echo "working release branch: ${RELEASE_BRANCH}"
echo "local repo dir: ~/${LOCAL_CLONE_DIR}/${XTABLE_REPO_DIR}"
echo "RC_NUM: $RC_NUM"
echo "==============================================================="

cd ~
vinishjail97 marked this conversation as resolved.
Show resolved Hide resolved
if [[ -d ${LOCAL_CLONE_DIR} ]]; then
rm -rf ${LOCAL_CLONE_DIR}
fi

mkdir ${LOCAL_CLONE_DIR}
cd ${LOCAL_CLONE_DIR}
git clone ${GITHUB_REPO_URL}
cd ${XTABLE_REPO_DIR}
vinishjail97 marked this conversation as resolved.
Show resolved Hide resolved

# Now, create local release branch
git branch ${RELEASE_BRANCH}

git checkout ${MAIN_BRANCH}
git checkout -b ${NEXT_VERSION_BRANCH}

echo "====================Current working branch====================="
echo ${NEXT_VERSION_BRANCH}
echo "==============================================================="

# Update main branch
mvn versions:set -DnewVersion=${NEXT_VERSION_IN_BASE_BRANCH}-SNAPSHOT

echo "===========Update next-version branch as following============="
git diff
echo "==============================================================="

echo "Please make sure all changes above are expected. Do you confirm to commit?: [y|N]"
read confirmation
if [[ $confirmation != "y" ]]; then
echo "Exit without committing any changes on main branch."
clean_up
exit
fi

git commit -am "[MINOR] Moving to ${NEXT_VERSION_IN_BASE_BRANCH}-SNAPSHOT on main branch."
## git push --set-upstream origin ${NEXT_VERSION_BRANCH}

echo "==============================================================="
echo "!!Please open a PR based on ${NEXT_VERSION_BRANCH} branch for approval!! [Press ENTER to continue]"
read confirmation

# Checkout and update release branch
git checkout ${RELEASE_BRANCH}
mvn versions:set -DnewVersion=${RELEASE}

echo "==================Current working branch======================="
echo ${RELEASE_BRANCH}
echo "==============================================================="

echo "===============Update release branch as following=============="
git diff
echo "==============================================================="

echo "Please make sure all changes above are expected. Do you confirm to commit?: [y|N]"
read confirmation
if [[ $confirmation != "y" ]]; then
echo "Exit without committing any changes on release branch."
clean_up
exit
fi

git commit -am "Create release branch for version ${RELEASE}."
git push --set-upstream origin ${RELEASE_BRANCH}

clean_up
57 changes: 57 additions & 0 deletions release/scripts/deploy_staging_jars.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#!/bin/bash
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
## Variables with defaults (if not overwritten by environment)
##
MVN=${MVN:-mvn}
# fail immediately
set -o errexit
set -o nounset

CURR_DIR=$(pwd)
if [ ! -d "$CURR_DIR/packaging" ] ; then
echo "You have to call the script from the repository root dir that contains 'packaging/'"
exit 1
fi

if [ "$#" -gt "1" ]; then
echo "Only accept 0 or 1 argument. Use -h to see examples."
exit 1
fi


if [ "${1:-}" == "-h" ]; then
echo "
Usage: $(basename "$0") [OPTIONS]

Options:
<version option> One of the version options below
${joined}
-h, --help
"
exit 0
fi


COMMON_OPTIONS="-DdeployArtifacts=true -DskipTests -DretryFailedDeploymentCount=10"
echo "Cleaning everything before any deployment"
$MVN clean $COMMON_OPTIONS
echo "Building with options
$MVN install $COMMON_OPTIONS

echo "Deploying to repository.apache.org with version options"
$MVN deploy $COMMON_OPTIONS
29 changes: 29 additions & 0 deletions release/scripts/validate_source_binary_files.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
set -o errexit
set -o nounset

echo "Checking for binary files in the source files"
numBinaryFiles=`find . -iname '*' | xargs -I {} file -I {} | grep -va directory | grep -v "release/" | grep -v "/src/test/" | grep -va 'application/json' | grep -va 'text/' | grep -va 'application/xml' | grep -va 'application/json' | wc -l | sed -e s'/ //g'`

if [ "$numBinaryFiles" -gt "0" ]; then
echo -e "There were non-text files in source release. [ERROR]\n Please check below\n"
find . -iname '*' | xargs -I {} file -I {} | grep -va directory | grep -v "release/release_guide" | grep -v "/src/test/" | grep -va 'application/json' | grep -va 'text/' | grep -va 'application/xml'
exit 1
fi
echo -e "\t\tNo Binary Files in the source files? - [OK]\n"
51 changes: 51 additions & 0 deletions release/scripts/validate_source_copyright.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/bin/bash
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
### Checking for DISCLAIMER-WIP
echo "Checking for DISCLAIMER-WIP"
disclaimerFile="./DISCLAIMER-WIP"
if [ ! -f "$disclaimerFile" ]; then
echo "DISCLAIMER-WIP file not be present [ERROR]"
exit 1
fi
echo -e "\t\tDISCLAIMER-WIP file exists ? [OK]\n"

### Checking for LICENSE and NOTICE
echo "Checking for LICENSE and NOTICE"
licenseFile="./LICENSE"
noticeFile="./NOTICE"
if [ ! -f "$licenseFile" ]; then
echo "License file missing [ERROR]"
exit 1
fi
echo -e "\t\tLicense file exists ? [OK]"

if [ ! -f "$noticeFile" ]; then
echo "Notice file missing [ERROR]"
exit 1
fi
echo -e "\t\tNotice file exists ? [OK]\n"

### Licensing Check
echo "Performing custom Licensing Check "
numfilesWithNoLicense=`find . -iname '*' -type f | grep -v NOTICE | grep -v LICENSE | grep -v '.jpg' | grep -v '.json' | grep -v '.hfile' | grep -v '.data' | grep -v '.commit' | grep -v emptyFile | grep -v DISCLAIMER | grep -v KEYS | grep -v '.mailmap' | grep -v '.sqltemplate' | grep -v 'banner.txt' | grep -v "fixtures" | xargs grep -L "Licensed to the Apache Software Foundation (ASF)" | wc -l`
if [ "$numfilesWithNoLicense" -gt "0" ]; then
echo "There were some source files that did not have Apache License [ERROR]"
find . -iname '*' -type f | grep -v NOTICE | grep -v LICENSE | grep -v '.jpg' | grep -v '.json' | grep -v '.hfile' | grep -v '.data' | grep -v '.commit' | grep -v emptyFile | grep -v DISCLAIMER | grep -v '.sqltemplate' | grep -v KEYS | grep -v '.mailmap' | grep -v 'banner.txt' | grep -v "fixtures" | xargs grep -L "Licensed to the Apache Software Foundation (ASF)"
exit 1
fi
echo -e "\t\tLicensing Check Passed [OK]\n"
20 changes: 20 additions & 0 deletions release/scripts/validate_source_rat.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
echo "Running RAT Check"
(bash -c "mvn apache-rat:check -DdeployArtifacts=true") || (echo -e "\t\t Rat Check Failed. [ERROR]\n\t\t Please run with --verbose to get details\n" && exit 1)
echo -e "\t\tRAT Check Passed [OK]\n"
Loading