-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f4be093
commit b3c657e
Showing
4 changed files
with
683 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,9 +62,19 @@ fi | |
|
||
current_branch=$(git branch | sed -n -e 's/^\* \(.*\)/\1/p') | ||
date=$(date "+%Y%m%d") | ||
dev_branch="release/v${version}-dev.${date}${incr}" | ||
canal_branch="release/v${version}-canal.${date}${incr}" | ||
dev_version="${version}-dev.${date}${incr}" | ||
canal_version="${version}-canal.${date}${incr}" | ||
dev_branch="release/v${dev_version}" | ||
canal_branch="release/v${canal_version}" | ||
|
||
if [ -n "$(git status --porcelain doc)" ]; then | ||
echo "ERROR: Please commit your modifications to \"${current_branch}\" first" | ||
exit 1 | ||
fi | ||
|
||
echo "This script will create the dev versions: $dev_version and $canal_version" | ||
|
||
echo "checking that the branches do not already exist locally or remotely..." | ||
if ! [ -z $(git branch --list "$dev_branch") ]; then | ||
err "Branch name "$dev_branch" already exists locally. Please delete it first." | ||
fi | ||
|
@@ -78,14 +88,67 @@ if ! [ -z $(git ls-remote --heads [email protected]:canalplus/rx-player.git "refs/h | |
err "Branch name "$canal_branch" already exists remotely. Please delete it first." | ||
fi | ||
|
||
if npm view rx-player@$version-dev.${date}${incr} >/dev/null 2>&1; then | ||
echo "checking that the versions are not already published on npm..." | ||
if npm view rx-player@$dev_version >/dev/null 2>&1; then | ||
err "Version already published to npm: $version-dev.${date}${incr}" | ||
fi | ||
|
||
if npm view rx-player@$version-canal.${date}${incr} >/dev/null 2>&1; then | ||
if npm view rx-player@$canal_version >/dev/null 2>&1; then | ||
err "Version already published to npm: $version-canal.${date}${incr}" | ||
fi | ||
|
||
# Make dev Changelog | ||
npm run releases:changelog -- $dev_version -d | ||
|
||
$EDITOR CHANGELOG.md | ||
|
||
if [ -n "$(git status --porcelain CHANGELOG.md)" ]; then | ||
echo "-- Current CHANGELOG.md Status: --" | ||
echo "" | ||
git status CHANGELOG.md | ||
|
||
while :; do | ||
echo "" | ||
echo "We will push this CHANGELOG.md update to ${current_branch}." | ||
read -p "do you want to continue [y/d/s/a/c/t/h] (h for help) ? " -n1 REPLY | ||
echo "" | ||
|
||
if [[ $REPLY =~ ^[Hh](elp)?$ ]]; then | ||
echo "" | ||
echo "" | ||
echo "+- help -------------------------------------------------+" | ||
echo "| y: commit and continue |" | ||
echo "| d: see diff |" | ||
echo "| s: see status |" | ||
echo "| a: abort script from here |" | ||
echo "| c: skip CHANGELOG.md update and go to the next step |" | ||
echo "| h: see this help |" | ||
echo "+--------------------------------------------------------+" | ||
elif [[ $REPLY =~ ^[Yy](es)?$ ]]; then | ||
git add CHANGELOG.md | ||
git commit -m "Update CHANGELOG.md for v$dev_version" | ||
git push [email protected]:canalplus/rx-player.git $current_branch | ||
break | ||
elif [[ $REPLY =~ ^[Dd](iff)?$ ]]; then | ||
git diff CHANGELOG.md || true # ignore when return 1 | ||
elif [[ $REPLY =~ ^[Ss](tatus)?$ ]]; then | ||
git status CHANGELOG.md | ||
elif [[ $REPLY =~ ^[Aa](bort)?$ ]]; then | ||
echo "exiting" | ||
exit 0 | ||
elif [[ $REPLY =~ ^[Cc](heckout)?$ ]]; then | ||
git checkout CHANGELOG.md | ||
else | ||
echo "invalid input" | ||
fi | ||
done | ||
fi | ||
|
||
if [ -n "$(git status --porcelain doc)" ]; then | ||
echo "ERROR: Unexpected diff in \"${current_branch}\"" | ||
exit 1 | ||
fi | ||
|
||
git checkout -b ${dev_branch} | ||
./scripts/update-version $version-dev.${date}${incr} | ||
git add --all | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -84,6 +84,7 @@ if [ -n "$(git status --porcelain)" ]; then | |
err "Please commit your modifications first" | ||
fi | ||
|
||
echo "Checking current branch is synchronized with remote..." | ||
check_branch_synchronized_with_remote | ||
|
||
if [ $# -eq 0 ]; then | ||
|
@@ -97,6 +98,9 @@ else | |
version=$1 | ||
fi | ||
|
||
emphasized_log "This script will create the official version: $version" | ||
|
||
echo "checking that the branche does not already exist locally or remotely..." | ||
if ! [ -z $(git branch --list "release/v$version") ]; then | ||
err "Branch name "release/v$version" already exists locally. Please delete it first." | ||
fi | ||
|
@@ -105,6 +109,7 @@ if ! [ -z $(git ls-remote --heads [email protected]:canalplus/rx-player.git "refs/h | |
err "Branch name "release/v$version" already exists remotely. Please delete it first." | ||
fi | ||
|
||
echo "checking that the version are not already published on npm..." | ||
if npm view rx-player@$version >/dev/null 2>&1; then | ||
err "Version already published to npm: $version" | ||
fi | ||
|
@@ -129,6 +134,58 @@ if [ -n "$(git status --porcelain)" ]; then | |
err "Error after doing rebases: updated files" | ||
fi | ||
|
||
# Make Changelog | ||
npm run releases:changelog -- $version | ||
|
||
$EDITOR CHANGELOG.md | ||
|
||
if [ -n "$(git status --porcelain CHANGELOG.md)" ]; then | ||
echo "-- Current CHANGELOG.md Status: --" | ||
echo "" | ||
git status CHANGELOG.md | ||
|
||
while :; do | ||
echo "" | ||
echo "We will push this CHANGELOG.md update to $base_branch." | ||
read -p "do you want to continue [y/d/s/a/c/t/h] (h for help) ? " -n1 REPLY | ||
echo "" | ||
|
||
if [[ $REPLY =~ ^[Hh](elp)?$ ]]; then | ||
echo "" | ||
echo "" | ||
echo "+- help -------------------------------------------------+" | ||
echo "| y: commit and continue |" | ||
echo "| d: see diff |" | ||
echo "| s: see status |" | ||
echo "| a: abort script from here |" | ||
echo "| c: skip CHANGELOG.md update and go to the next step |" | ||
echo "| h: see this help |" | ||
echo "+--------------------------------------------------------+" | ||
elif [[ $REPLY =~ ^[Yy](es)?$ ]]; then | ||
git add CHANGELOG.md | ||
git commit -m "Update CHANGELOG.md for v$version" | ||
git push [email protected]:canalplus/rx-player.git $base_branch | ||
break | ||
elif [[ $REPLY =~ ^[Dd](iff)?$ ]]; then | ||
git diff CHANGELOG.md || true # ignore when return 1 | ||
elif [[ $REPLY =~ ^[Ss](tatus)?$ ]]; then | ||
git status CHANGELOG.md | ||
elif [[ $REPLY =~ ^[Aa](bort)?$ ]]; then | ||
echo "exiting" | ||
exit 0 | ||
elif [[ $REPLY =~ ^[Cc](heckout)?$ ]]; then | ||
git checkout CHANGELOG.md | ||
else | ||
echo "invalid input" | ||
fi | ||
done | ||
fi | ||
|
||
if [ -n "$(git status --porcelain doc)" ]; then | ||
echo "ERROR: Unexpected diff in \"$base_branch\"" | ||
exit 1 | ||
fi | ||
|
||
emphasized_log "Creating \"release/v$version\" branch..." | ||
git checkout -b "release/v$version" | ||
|
||
|
Oops, something went wrong.