Skip to content

Commit

Permalink
Merge pull request #320 from XeroAPI/PETOSS-535-Publish-Ruby-SDK-afte…
Browse files Browse the repository at this point in the history
…r-manual-release-from-GitHub

Petoss 535 publish ruby sdk after manual release from GitHub
  • Loading branch information
vigneshk-tw authored Sep 27, 2024
2 parents 30257b1 + 7a8c31c commit a6b0c4e
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Publish
on:
release:
types: [published]

jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout xero-ruby repo
uses: actions/checkout@v4
with:
repository: XeroAPI/xero-ruby
path: xero-ruby

- name: Set up Ruby environment
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2.0'
bundler-cache: true

- name: Install dependencies
run: bundle install
working-directory: xero-ruby

- name: Publish to Ruby
env:
GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
run: |
gemspec_file=$(ls *.gemspec)
gem_file=$(gem build "$gemspec_file" | grep -o '[^ ]*\.gem')
echo "$gem_file"
gem push "$gem_file"
working-directory: xero-ruby

0 comments on commit a6b0c4e

Please sign in to comment.