Skip to content

Commit

Permalink
Use output
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenyeargin committed Jan 20, 2024
1 parent 2519022 commit 27348ca
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/gem-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,10 @@ jobs:
continue-on-error: true
run: |
bundle install
rake check_version
echo "VERSION_EXISTS=$?" >> $GITHUB_OUTPUT
echo "version_status=$(rake check_version)" >> $GITHUB_OUTPUT
- name: Publish to GPR
if: ${{ steps.checkversionexists.outputs.VERSION_EXISTS == 0 }}
if: ${{ steps.checkversionexists.outputs.version_status == 'new' }}
run: |
mkdir -p $HOME/.gem
touch $HOME/.gem/credentials
Expand All @@ -46,7 +45,7 @@ jobs:
OWNER: ${{ github.repository_owner }}

- name: Publish to RubyGems
if: ${{ steps.checkversionexists.outputs.VERSION_EXISTS == 0 }}
if: ${{ steps.checkversionexists.outputs.version_status == 'new' }}
run: |
mkdir -p $HOME/.gem
touch $HOME/.gem/credentials
Expand Down
8 changes: 3 additions & 5 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@ task :check_version do
response = Net::HTTP.get_response(URI.parse(url))

if response.code == '200'
puts "Version #{version} exists on rubygems"
exit 1
puts 'exists'
else
puts 'new'
end

puts "Version #{version} does not exist on rubygems"
exit 0
end

0 comments on commit 27348ca

Please sign in to comment.