Skip to content

Commit

Permalink
add release script
Browse files Browse the repository at this point in the history
  • Loading branch information
gimmyxd committed Nov 29, 2023
1 parent b8ed463 commit c815be5
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"lint": "eslint lib --max-warnings=0",
"prepublishOnly": "NODE_ENV=production yarn build",
"push": "scripts/publish.sh",
"release": "scripts/release.sh",
"test": "jest test --coverage --verbose"
},
"files": [
Expand Down
20 changes: 20 additions & 0 deletions scripts/release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash
set -e

echo "fetch latest changes"
git checkout main
git fetch origin --tags
git pull origin main

# bump the patch number in the version
echo "bumping version..."
VERSION=$(npm version patch --no-git-tag-version)
echo $VERSION

echo "commit and push changes"
git commit -am "bumped version to $VERSION"
git push -u origin main

echo "tag and push v$VERSION"
git tag "v$VERSION"
git push --tags

0 comments on commit c815be5

Please sign in to comment.