Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ruby release action #1051

Merged
merged 3 commits into from
May 2, 2022
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 33 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,31 @@
name: CI

on:
workflow_dispatch: {}
push:
branches: [ master ]
pakrym-stripe marked this conversation as resolved.
Show resolved Hide resolved
pull_request:
branches: [ master ]

jobs:
lint:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- 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
Expand All @@ -32,3 +42,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 == 'push') || (github.event_name == 'workflow_dispatch')) && startsWith(github.ref, 'refs/tags/v') && endsWith(github.actor, '-stripe'))
pakrym-stripe marked this conversation as resolved.
Show resolved Hide resolved
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 NuGet packages to NuGet
pakrym-stripe marked this conversation as resolved.
Show resolved Hide resolved
run: gem push gems/*.gem
env:
GEM_HOST_API_KEY: ${{secrets.GEM_HOST_API_KEY}}