Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: update lerna + add new release-specific and release candidate-s…
…pecific bash scripts
- Loading branch information
Showing
8 changed files
with
149 additions
and
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,3 +30,5 @@ coverage | |
.vscode/ | ||
*.report.html | ||
|
||
# used when doing subtree splitting to read-only repos | ||
.subsplit |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
# Borrowed with gratitude from Create React App by Facebook; thanks! | ||
set -e | ||
cd "$(dirname "$0")" # Start in the scripts/release folder, even if run from root directory | ||
cd ../../ | ||
|
||
CURRENT_VERSION=`git describe --abbrev=0` | ||
git push origin :refs/tags/$CURRENT_VERSION | ||
node scripts/release/update-php-package-versions.js | ||
|
||
git add . | ||
git commit --amend --no-edit | ||
git tag -f $CURRENT_VERSION | ||
git push --force --no-verify | ||
git push --tags --force --no-verify | ||
|
||
## Update snapshot tests that depend on | ||
./scripts/release/update-read-only-git-repos.sh |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
# Borrowed with gratitude from Create React App by Facebook; thanks! | ||
set -e | ||
cd "$(dirname "$0")" # Start in the scripts/release folder, even if run from root directory | ||
cd ../../ | ||
|
||
if [ -n "$(git status --porcelain)" ]; then | ||
echo "Error: your git status is not clean. Aborting release."; | ||
exit 1; | ||
fi | ||
|
||
# remove the temp verdaccio folder before publishing or running through any tests | ||
# rm -rf ./scripts/release/verdaccio/storage/@bolt | ||
|
||
npm run lint | ||
npm run test | ||
|
||
echo 'Finished release pre-checks!'; |
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
# Borrowed with gratitude from Create React App by Facebook; thanks! | ||
set -e | ||
cd "$(dirname "$0")" # Start in the scripts/release folder, even if run from root directory | ||
cd ../../ | ||
|
||
CURRENT_BRANCH=`git rev-parse --symbolic-full-name --abbrev-ref HEAD` | ||
|
||
DEFAULT_BUMP="preminor" | ||
BUMP=${1:-$DEFAULT_BUMP} | ||
|
||
if [[ $CURRENT_BRANCH == 'release/2.x' || $CURRENT_BRANCH == 'release/1.x' ]]; then | ||
echo "Error: you can't publish a pre-release on a release branch! Try running 'npm run release' to do a full release instead."; | ||
exit 1; | ||
elif [[ $CURRENT_BRANCH != 'next/2.x' && $CURRENT_BRANCH != 'next/1.x' ]]; then | ||
echo "Error: you can't publish a pre-release on the $CURRENT_BRANCH branch. Aborting..."; | ||
exit 1; | ||
fi | ||
|
||
./scripts/release/before-release.sh #verify everything is good to go before publishing | ||
npx lerna publish $BUMP --npm-tag next --preid rc --no-commit-hooks --no-git-reset --verify-access --conventional-commits | ||
./scripts/release/after-release.sh #post-release work | ||
|
||
|
||
# test the pre-release process works via verdaccio instead of NPM | ||
# ./scripts/release/before-release.sh | ||
# npx lerna publish $BUMP --registry http://localhost:4000 --npm-tag next --preid rc --no-commit-hooks --no-git-reset --verify-access --conventional-commits | ||
# ./scripts/release/after-release.sh |
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
# Borrowed with gratitude from Create React App by Facebook; thanks! | ||
set -e | ||
cd "$(dirname "$0")" # Start in the scripts/release folder, even if run from root directory | ||
cd ../../ | ||
|
||
CURRENT_BRANCH=`git rev-parse --symbolic-full-name --abbrev-ref HEAD` | ||
|
||
DEFAULT_BUMP="minor" | ||
BUMP=${1:-$DEFAULT_BUMP} | ||
|
||
if [[ $CURRENT_BRANCH == 'next/2.x' || $CURRENT_BRANCH == 'next/1.x' ]]; then | ||
echo "Error: you can't do a full release on a pre-release branch! Try running 'npm run release:rc' to do a pre-release instead."; | ||
exit 1; | ||
elif [[ $CURRENT_BRANCH != 'release/2.x' && $CURRENT_BRANCH != 'release/1.x' ]]; then | ||
echo "Error: you can't publish a full release on the $CURRENT_BRANCH branch. Aborting..."; | ||
exit 1; | ||
fi | ||
|
||
./scripts/release/before-release.sh | ||
npx lerna publish $BUMP --no-commit-hooks --no-git-reset --verify-access --conventional-commits | ||
./scripts/release/after-release.sh | ||
|
||
|
||
# test the release process works via verdaccio instead of NPM | ||
# ./scripts/release/before-release.sh | ||
# npx lerna publish $BUMP --registry http://localhost:4000 --no-commit-hooks --no-git-reset --verify-access --conventional-commits | ||
# ./scripts/release/after-release.sh |
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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/usr/bin/env bash | ||
cd "$(dirname "$0")" | ||
cd ../../ | ||
|
||
# Run helper subsplit script ported over from from https://raw.githubusercontent.com/dflydev/git-subsplit/master/git-subsplit.sh | ||
CURRENT_VERSION=`git describe --abbrev=0` | ||
CURRENT_BRANCH=`git rev-parse --symbolic-full-name --abbrev-ref HEAD` | ||
|
||
if [ -n "$(git status --porcelain)" ]; then | ||
echo "Error: your git status is not clean. Aborting release."; | ||
exit 1; | ||
fi | ||
|
||
if [[ $TRAVIS_TAG ]]; then | ||
echo "This is a tagged git release so we will update read-only git repos..."; | ||
|
||
./scripts/release/git-subsplit.sh init https://${GH_TOKEN}@github.com/bolt-design-system/core-php.git | ||
./scripts/release/git-subsplit.sh publish --work-dir=$PWD packages/core-php:https://${GH_TOKEN}@github.com/bolt-design-system/core-php.git \ | ||
--no-heads --update --tags="$CURRENT_VERSION" | ||
rm -rf .subsplit | ||
|
||
./scripts/release/git-subsplit.sh init https://${GH_TOKEN}@github.com/bolt-design-system/bolt_connect.git | ||
./scripts/release/git-subsplit.sh publish --work-dir=$PWD packages/drupal-modules/bolt_connect:https://${GH_TOKEN}@github.com/bolt-design-system/bolt_connect.git \ | ||
--no-heads --update --tags="$CURRENT_VERSION" | ||
rm -rf .subsplit | ||
|
||
git checkout $CURRENT_BRANCH # return back to the branch you started on before exiting | ||
echo "Finished syncing up the remote git repos!"; | ||
exit; | ||
|
||
#@todo: update to support future major releases | ||
elif [[ $CURRENT_BRANCH != 'release/2.x' && $CURRENT_BRANCH != 'release/1.x' && $CURRENT_BRANCH != 'master' && $CURRENT_BRANCH != 'next/2.x' && $CURRENT_BRANCH != 'next/3.x' ]]; then | ||
echo "This is not a tagged git release or a release-related branch -- skipped updating remote repos!"; | ||
exit; | ||
else | ||
echo "This is not a tagged git release but it IS a release-related branch -- updating remote repos!" | ||
./scripts/release/git-subsplit.sh init https://${GH_TOKEN}@github.com/bolt-design-system/core-php.git | ||
./scripts/release/git-subsplit.sh publish --work-dir=$PWD packages/core-php:https://${GH_TOKEN}@github.com/bolt-design-system/core-php.git \ | ||
--heads="$CURRENT_BRANCH" --update --no-tags | ||
rm -rf .subsplit | ||
|
||
./scripts/release/git-subsplit.sh init https://${GH_TOKEN}@github.com/bolt-design-system/bolt_connect.git | ||
./scripts/release/git-subsplit.sh publish --work-dir=$PWD packages/drupal-modules/bolt_connect:https://${GH_TOKEN}@github.com/bolt-design-system/bolt_connect.git \ | ||
--heads="$CURRENT_BRANCH" --update --no-tags | ||
rm -rf .subsplit | ||
|
||
git checkout $CURRENT_BRANCH # return back to the branch you started on before exiting | ||
echo "Finished syncing up the remote git repos!"; | ||
exit; | ||
fi |
This file was deleted.
Oops, something went wrong.