-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
chore: add prerelease script #876
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
e2e8180
chore: add prerelease script
endiliey 35cc1dc
Update prerelease.md
yangshun 449f252
Update prerelease.sh
yangshun dd46a49
Update prerelease.sh
yangshun 7e7ffa6
chore: address review
endiliey 059a3de
update instruction
endiliey 11fa2db
alias 'run version' to make it clear we're running docs version
endiliey 6279e74
indicate that we are creating commit, not pull request
endiliey 785cb81
update asciinema preview
endiliey e87969a
nits
endiliey File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should create new branch before bumping version just to be safe.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did this because I wanted to get the new version (after bump) as the branch name. How about naming it to
prerelease
? We can also delete the existing localprerelease
branch as well before creating new branchThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mm gotcha. Let's leave this as it is. On second thought it's fine because we're not committing yet.