mirror of
https://github.com/stripe/stripe-ruby.git
synced 2025-10-03 00:01:21 -04:00
Add ruby release action (#1051)
This commit is contained in:
parent
d064a77ca7
commit
e671382a94
38
.github/workflows/ci.yml
vendored
38
.github/workflows/ci.yml
vendored
@ -1,11 +1,16 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
workflow_dispatch: {}
|
||||
push:
|
||||
branches: [ master ]
|
||||
tags:
|
||||
- v[0-9]+.[0-9]+.[0-9]+*
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
@ -13,9 +18,16 @@ jobs:
|
||||
- name: Set up Ruby
|
||||
uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: 2.7
|
||||
- name: rubocop
|
||||
ruby-version: 3.1
|
||||
- name: Lint
|
||||
run: bundle install && bundle exec rake rubocop
|
||||
- name: Build
|
||||
run: gem build stripe.gemspec
|
||||
- name: 'Upload Artifact'
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: gems
|
||||
path: '*.gem'
|
||||
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
@ -32,3 +44,23 @@ jobs:
|
||||
run: docker run -d -p 12111-12112:12111-12112 stripe/stripe-mock && sleep 5
|
||||
- name: test
|
||||
run: bundle install && bundle exec rake test
|
||||
|
||||
publish:
|
||||
name: Publish
|
||||
if: (((github.event_name == 'workflow_dispatch')) && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v')) && endsWith(github.actor, '-stripe'))
|
||||
needs: [build, test]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Download all workflow run artifacts
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: gems
|
||||
path: gems
|
||||
- name: Set up Ruby
|
||||
uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: 3.1
|
||||
- name: Publish gems to Rubygems
|
||||
run: gem push gems/*.gem
|
||||
env:
|
||||
GEM_HOST_API_KEY: ${{secrets.GEM_HOST_API_KEY}}
|
||||
|
Loading…
x
Reference in New Issue
Block a user