-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: add prerelease script * Update prerelease.md * Update prerelease.sh * Update prerelease.sh * chore: address review * update instruction * alias 'run version' to make it clear we're running docs version * indicate that we are creating commit, not pull request * update asciinema preview * nits
- Loading branch information
Showing
2 changed files
with
75 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Prereleasing New Version of Docusaurus | ||
|
||
[![asciicast](https://asciinema.org/a/hZ7NNJPcgtdvzm5tMLLfHflMD.png)](https://asciinema.org/a/hZ7NNJPcgtdvzm5tMLLfHflMD) | ||
|
||
# Steps | ||
|
||
1. Ensure that `origin` remote is your Docusaurus fork and `upstream` is Docusaurus original repository. | ||
|
||
```bash | ||
$ git remote -v | ||
origin https://github.com/endiliey/Docusaurus.git (fetch) | ||
origin https://github.com/endiliey/Docusaurus.git (push) | ||
upstream https://github.com/facebook/Docusaurus.git (fetch) | ||
upstream https://github.com/facebook/Docusaurus.git (push) | ||
``` | ||
|
||
2. Pull latest changes from Docusaurus repository. | ||
|
||
```bash | ||
$ git fetch upstream && git checkout master && git merge upstream/master | ||
``` | ||
|
||
2. Modify `CHANGELOG.md` and other necessary files. Do not commit the changes. | ||
3. Run `bash scripts/prerelease.sh`. | ||
4. Create your pull request on GitHub. | ||
|
||
<img width="629" alt="pull request" src="https://user-images.githubusercontent.com/17883920/43393765-ccb050ac-942a-11e8-94e8-d585034fa064.PNG"> |
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,48 @@ | ||
#!/bin/bash | ||
|
||
DOCS_VERSION_COMMAND="run version" | ||
|
||
echo "Select an option for release:" | ||
echo | ||
|
||
select VERSION in patch minor major "Specific Version" | ||
do | ||
echo | ||
if [[ $REPLY =~ ^[1-4]$ ]]; then | ||
if [[ $REPLY == 4 ]]; then | ||
read -p "Enter a specific version: " -r VERSION | ||
echo | ||
if [[ -z $REPLY ]]; then | ||
VERSION=$REPLY | ||
fi | ||
fi | ||
|
||
read -p "Create $VERSION commit - Are you sure ... (y/n) " -n 1 -r | ||
echo | ||
|
||
if [[ $REPLY =~ ^[Yy]$ || -z $REPLY ]]; then | ||
# bump version | ||
yarn version --new-version $VERSION --no-git-tag-version | ||
NEW_VERSION=$(node -p "require('./package.json').version") | ||
|
||
# create new branch | ||
git checkout -b $NEW_VERSION master | ||
|
||
# cut docusaurus docs version | ||
cd website && yarn $DOCS_VERSION_COMMAND $NEW_VERSION | ||
|
||
# Create commit | ||
git add . | ||
git commit -m "v$NEW_VERSION" | ||
git push origin $NEW_VERSION | ||
echo "Finished" | ||
else | ||
echo Cancelled | ||
fi | ||
break | ||
else | ||
echo Invalid \"${REPLY}\" | ||
echo "To continue, please enter one of the options (1-4):" | ||
echo | ||
fi | ||
done |