Skip to content

Commit

Permalink
migrate CI+release from Travis to GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
bastelfreak committed Jun 18, 2021
1 parent ef93954 commit f46eea8
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 24 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Release

on:
create:
ref_type: tag

jobs:
release:
runs-on: ubuntu-latest
if: github.repository == 'voxpupuli/facterdb'
steps:
- uses: actions/checkout@v2
- name: Install Ruby 3.0
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
env:
BUNDLE_WITHOUT: release
- name: Build gem
run: gem build *.gemspec
- name: Publish gem to rubygems.org
run: gem push *.gem
env:
GEM_HOST_API_KEY: '${{ secrets.RUBYGEMS_AUTH_TOKEN }}'
- name: Setup GitHub packages access
run: |
mkdir -p ~/.gem
echo ":github: Bearer ${{ secrets.GITHUB_TOKEN }}" >> ~/.gem/credentials
chmod 0600 ~/.gem/credentials
- name: Publish gem to GitHub packages
run: gem push --key github --host https://rubygems.pkg.github.com/voxpupuli *.gem
28 changes: 28 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Test

on:
- pull_request
- push

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby:
- '2.5'
- '2.6'
- '2.7'
- '3.0'
steps:
- uses: actions/checkout@v2
- name: Install Ruby ${{ matrix.ruby }}
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
env:
BUNDLE_WITHOUT: release
- name: Run tests
run: bundle exec rake spec
24 changes: 0 additions & 24 deletions .travis.yml

This file was deleted.

0 comments on commit f46eea8

Please sign in to comment.