Skip to content

Commit

Permalink
DEV: Add automatic gem publishing (#205)
Browse files Browse the repository at this point in the history
  • Loading branch information
CvX authored Dec 22, 2021
1 parent 098e26f commit d44f9b3
Showing 1 changed file with 23 additions and 7 deletions.
30 changes: 23 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Test Exporter
name: CI

on:
push:
Expand All @@ -12,18 +12,19 @@ jobs:
build:
runs-on: ubuntu-latest
name: Ruby ${{ matrix.ruby }} AR ${{ matrix.activerecord }}
timeout-minutes: 10

env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/ar_${{ matrix.activerecord }}.gemfile

strategy:
fail-fast: false
matrix:
ruby: ['3.0', '2.7', '2.6']
activerecord: ['61', '60']
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/ar_${{ matrix.activerecord }}.gemfile
ruby: [2.6, 2.7, 3.0]
activerecord: [60, 61]

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1

- uses: ruby/setup-ruby@v1
with:
Expand All @@ -35,3 +36,18 @@ jobs:

- name: Run tests
run: bundle exec rake

publish:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
needs: build
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Release gem
uses: discourse/publish-rubygems-action@v2
env:
RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
GIT_EMAIL: [email protected]
GIT_NAME: discoursebot

0 comments on commit d44f9b3

Please sign in to comment.