Skip to content

Commit 541e641

Browse files
Merge pull request #38 from merge-api/nitesh/update-ci-action
update ruby client ci to complile + test on push
2 parents fa97937 + 2f1628e commit 541e641

File tree

2 files changed

+57
-26
lines changed

2 files changed

+57
-26
lines changed

.github/workflows/ci.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: ci
2+
3+
on: [push]
4+
5+
jobs:
6+
compile:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- name: Checkout repo
11+
uses: actions/checkout@v4
12+
13+
- name: Set up Ruby
14+
uses: ruby/setup-ruby@v1
15+
with:
16+
ruby-version: '2.7'
17+
18+
- name: Build gem
19+
run: gem build merge_ruby_client.gemspec
20+
21+
test:
22+
runs-on: ubuntu-latest
23+
24+
steps:
25+
- name: Checkout repo
26+
uses: actions/checkout@v4
27+
28+
- name: Set up Ruby
29+
uses: ruby/setup-ruby@v1
30+
with:
31+
ruby-version: '2.7'
32+
33+
- name: Run tests
34+
run: bundle install && bundle exec rake test
35+
36+
publish:
37+
needs: [ compile, test ]
38+
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
39+
runs-on: ubuntu-latest
40+
steps:
41+
- name: Checkout repo
42+
uses: actions/checkout@v3
43+
44+
- uses: ruby/setup-ruby@v1
45+
with:
46+
ruby-version: 2.7
47+
bundler-cache: true
48+
49+
- name: Test gem
50+
run: bundle install && bundle exec rake test
51+
52+
- name: Build and Push Gem
53+
env:
54+
GEM_HOST_API_KEY: ${{ secrets.RUBY_GEMS_API_KEY }}
55+
run: |
56+
gem build merge_ruby_client.gemspec
57+
gem push merge_ruby_client-*.gem --host https://rubygems.org/

.github/workflows/publish.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)