Skip to content

Commit d0021a9

Browse files
authored
Merge pull request #120 from nk-ty/fix-deploy-rubygem
fix: Add error handling and fix sed option for linux
2 parents 5e5d5e2 + 1a11114 commit d0021a9

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

.circleci/deploy_to_rubygems.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1+
#!/bin/bash
2+
set -eu
3+
14
VERSION=$(git describe --tags | grep -o -E "([0-9]+\.){1}[0-9]+(\.[0-9]+)?" | head -n1)
25
git config user.email "bucky-operator@users.noreply.github.com"
36
git config user.name "bucky-operator"
47
# Update version.rb
5-
sed -i '' -e "s/VERSION = '[0-9]\{1,\}.[0-9]\{1,\}.[0-9]\{1,\}'/VERSION = '$VERSION'/" lib/bucky/version.rb
8+
sed -i -e "s/VERSION = '[0-9]\+\.[0-9]\+\.[0-9]\+'/VERSION = '$VERSION'/" lib/bucky/version.rb
69
git diff
710
git checkout master
811
git add lib/bucky/version.rb
@@ -11,4 +14,4 @@ git commit -m "Version $VERSION"
1114
gem build bucky-core.gemspec
1215
gem push "bucky-core-$VERSION.gem"
1316
# Push to master
14-
git push origin master
17+
git push origin master

.circleci/setup_rubygems.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#!/bin/bash
2+
set -eu
3+
14
mkdir ~/.gem
25
echo -e "---\r\n:rubygems_api_key: $RUBYGEMS_API_KEY" > ~/.gem/credentials
3-
chmod 0600 /home/circleci/.gem/credentials
6+
chmod 0600 /home/circleci/.gem/credentials

0 commit comments

Comments
 (0)