Skip to content

Commit

Permalink
Update publishing_sift_ruby.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
ssalamakha-sift authored Aug 29, 2023
1 parent 42ab20d commit 7b72bf0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .github/workflows/publishing_sift_ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,17 @@ jobs:
- name: Build and push gem
run: |
mkdir -p $HOME/.gem
touch $HOME/.gem/credentials
chmod 0600 $HOME/.gem/credentials
printf -- "---\n:rubygems_api_key: ${{ secrets.GH_RGEMS_KEY }}\n" > $HOME/.gem/credentials
version=$(awk -F'"' '/ VERSION = / {print $2}' < lib/sift/version.rb)
all_versions=$(gem list -r -e --all sift --no-verbose)
if [[ $all_versions != *"$version"* ]]; then
echo "Gem version does not exist on RubyGems. Building and pushing!"
gem build sift.gemspec
gem push sift-$version.gem --key ${{ secrets.GH_RGEMS_KEY }}
gem push sift-$version.gem --key rubygems_api_key
rm -rf $HOME/.gem
else
echo "Gem version $version exists on RubyGems"
fi
Expand Down

0 comments on commit 7b72bf0

Please sign in to comment.