File tree Expand file tree Collapse file tree 1 file changed +19
-4
lines changed
Expand file tree Collapse file tree 1 file changed +19
-4
lines changed Original file line number Diff line number Diff line change 33VERSION=$1
44
55if [ -z " $VERSION " ]; then
6- echo " Error: The version number is required."
7- echo " Usage: $0 <version-number>"
6+ echo " Error: Version number or bump type is required."
7+ echo " Usage: $0 <major|minor|patch|version-number>"
8+
89 exit 1
910fi
1011
12+ if [[ " $VERSION " =~ ^(major| minor| patch)$ ]]; then
13+ CURRENT=$( grep -o ' "[^"]*"' ./lib/rails_icons/version.rb | tr -d ' "' )
14+ IFS=' .' read -r MAJOR MINOR PATCH <<< " $CURRENT"
15+
16+ case $VERSION in
17+ major) VERSION=" $(( MAJOR + 1 )) .0.0" ;;
18+ minor) VERSION=" $MAJOR .$(( MINOR + 1 )) .0" ;;
19+ patch) VERSION=" $MAJOR .$MINOR .$(( PATCH + 1 )) " ;;
20+ esac
21+ fi
22+
1123printf " module RailsIcons\n VERSION = \" $VERSION \" \nend\n" > ./lib/rails_icons/version.rb
24+
1225bundle
26+
1327git add Gemfile.lock lib/rails_icons/version.rb
1428git commit -m " Bump version for $VERSION "
1529git push
1630git tag v$VERSION
1731git push --tags
18- gem build rails_icons.gemspec
19- gem push " rails_icons-$VERSION .gem"
32+
33+ bundle exec rake build
34+ gem push " pkg/rails_icons-$VERSION .gem"
You can’t perform that action at this time.
0 commit comments