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

release: Add support for ZSH in RELEASING and add tagging instructions #9451

Merged
merged 2 commits into from Apr 6, 2020
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
40 changes: 25 additions & 15 deletions RELEASING/README.md
Expand Up @@ -65,26 +65,27 @@ the wrong files/using wrong names. There's a script to help you set correctly al
necessary environment variables. Change your current directory to `superset/RELEASING`

```bash
# usage: . set_release_env.sh <SUPERSET_VERSION_RC> <PGP_KEY_FULLNAME>
# example: . set_release_env.sh 0.35.2rc1 myid@apache.org
# usage (BASH): . set_release_env.sh <SUPERSET_RC_VERSION> <PGP_KEY_FULLNAME>
# usage (ZSH): source set_release_env.sh <SUPERSET_RC_VERSION> <PGP_KEY_FULLNAME>
#
# example: source set_relese_env.sh 0.36.0rc3 myid@apache.org
```

The script will output the exported variables. Here's example for 0.35.2rc2:
The script will output the exported variables. Here's example for 0.36.0rc3:

```
-------------------------------
Set Release env variables
SUPERSET_VERSION=0.36.0
SUPERSET_RC=3
SUPERSET_GITHUB_BRANCH=0.36
SUPERSET_PGP_FULLNAME=myid@apache.org
SUPERSET_VERSION_RC=0.35.2rc1
SUPERSET_GITHUB_BRANCH=0.35
SUPERSET_TMP_ASF_SITE_PATH=/tmp/incubator-superset-site-0.35.2
SUPERSET_RELEASE_RC=apache-superset-incubating-0.35.2rc1
SUPERSET_RELEASE_RC_TARBALL=apache-superset-incubating-0.35.2rc1-source.tar.gz
SUPERSET_RC=1
SUPERSET_CONFIG_PATH=/Users/ville/superset/superset_config.py
SUPERSET_RELEASE=apache-superset-incubating-0.35.2
SUPERSET_RELEASE_TARBALL=apache-superset-incubating-0.35.2-source.tar.gz
SUPERSET_VERSION=0.35.2
SUPERSET_VERSION_RC=0.36.0rc3
SUPERSET_RELEASE=apache-superset-incubating-0.36.0
SUPERSET_RELEASE_RC=apache-superset-incubating-0.36.0rc3
SUPERSET_RELEASE_TARBALL=apache-superset-incubating-0.36.0-source.tar.gz
SUPERSET_RELEASE_RC_TARBALL=apache-superset-incubating-0.36.0rc3-source.tar.gz
SUPERSET_TMP_ASF_SITE_PATH=/tmp/incubator-superset-site-0.36.0
-------------------------------
```

Expand Down Expand Up @@ -114,10 +115,19 @@ section for the new release.
Finally bump the version number on `superset-frontend/package.json` (replace with whichever version is being released excluding the RC version):

```json
"version": "0.35.2"
"version": "0.36.0"
```

Commit the change with the version number, then git tag the version with the release candidate and push to the branch
Commit the change with the version number, then git tag the version with the release candidate and push to the branch:

```
# add changed files and commit
git add ...
git commit ...
# push new tag
git tag ${SUPERSET_VERSION_RC}
git push upstream ${SUPERSET_VERSION_RC}
```

## Preparing the release candidate

Expand Down
25 changes: 19 additions & 6 deletions RELEASING/set_release_env.sh
Expand Up @@ -16,18 +16,31 @@
# limitations under the License.
#
usage() {
echo "usage: . set_release_env.sh <SUPERSET_RC_VERSION> <PGP_KEY_FULLBANE>"
echo "example: . set_relese_env.sh 0.35.2rc1 myid@apache.org"
echo "usage (BASH): . set_release_env.sh <SUPERSET_RC_VERSION> <PGP_KEY_FULLNAME>"
echo "usage (ZSH): source set_release_env.sh <SUPERSET_RC_VERSION> <PGP_KEY_FULLNAME>"
echo
echo "example: source set_relese_env.sh 0.36.0rc3 myid@apache.org"
}

if [ -z "$1" ] || [ -z "$2" ]; then
usage;
else
if [[ ${1} =~ ^([0-9]+)\.([0-9]+)\.([0-9]+)rc([0-9]+)$ ]]; then
VERSION_MAJOR="${BASH_REMATCH[1]}"
VERSION_MINOR="${BASH_REMATCH[2]}"
VERSION_PATCH="${BASH_REMATCH[3]}"
VERSION_RC="${BASH_REMATCH[4]}"
if [ -n "$ZSH_VERSION" ]; then
VERSION_MAJOR="${match[1]}"
VERSION_MINOR="${match[2]}"
VERSION_PATCH="${match[3]}"
VERSION_RC="${match[4]}"
elif [ -n "$BASH_VERSION" ]; then
VERSION_MAJOR="${BASH_REMATCH[1]}"
VERSION_MINOR="${BASH_REMATCH[2]}"
VERSION_PATCH="${BASH_REMATCH[3]}"
VERSION_RC="${BASH_REMATCH[4]}"
else
echo "Unsupported shell type, only zsh and bash supported"
exit 1
fi

else
echo "unable to parse version string ${1}. Example of valid version string: 0.35.2rc1"
exit 1
Expand Down