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

chore: further automate release process #235

Merged
merged 2 commits into from
Feb 5, 2021
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ To release a new version, run `./script/release`. You will need to be logged in

The script automatically prepares a [GitHub Release](https://docs.github.com/en/github/administering-a-repository/about-releases) and opens a pre-populated form in your browser. Please complete the GitHub Release creation manually.

You will also need to manually checkout a new branch and open a PR containing version bump changes which are automatically committed during the release process.
It will also automatically create a PR to edit `version` in [`package.json`](./package.json).

### A note about release numbers

Expand Down
14 changes: 14 additions & 0 deletions script/release
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,20 @@ DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
if npm whoami &>/dev/null; then
rm -rf ./lib
npm run release

# The default branch is protected.
# Push commit to new branch.
NEW_VERSION=$(git log -1 --pretty=%B)
git checkout -b "release-${NEW_VERSION}"
git push -u origin "release-${NEW_VERSION}"

if ! command -v gh &> /dev/null
then
echo "GitHub CLI not found. Please raise PR manually."
else
# Raise a chore PR to bump `version` in `package.json`.
gh pr create --title "chore: ${NEW_VERSION}" --body ""
fi
else
echo "You are not logged into npm!"
echo " Run 'npm login' first!"
Expand Down