Skip to content

Commit a6b0c4e

Browse files
authored
Merge pull request #320 from XeroAPI/PETOSS-535-Publish-Ruby-SDK-after-manual-release-from-GitHub
Petoss 535 publish ruby sdk after manual release from GitHub
2 parents 30257b1 + 7a8c31c commit a6b0c4e

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Publish
2+
on:
3+
release:
4+
types: [published]
5+
6+
jobs:
7+
publish:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout xero-ruby repo
11+
uses: actions/checkout@v4
12+
with:
13+
repository: XeroAPI/xero-ruby
14+
path: xero-ruby
15+
16+
- name: Set up Ruby environment
17+
uses: ruby/setup-ruby@v1
18+
with:
19+
ruby-version: '3.2.0'
20+
bundler-cache: true
21+
22+
- name: Install dependencies
23+
run: bundle install
24+
working-directory: xero-ruby
25+
26+
- name: Publish to Ruby
27+
env:
28+
GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
29+
run: |
30+
gemspec_file=$(ls *.gemspec)
31+
gem_file=$(gem build "$gemspec_file" | grep -o '[^ ]*\.gem')
32+
echo "$gem_file"
33+
gem push "$gem_file"
34+
working-directory: xero-ruby

0 commit comments

Comments
 (0)