Skip to content

Commit

Permalink
Merge pull request #82 from TransbankDevelopers/chore/change-travis-f…
Browse files Browse the repository at this point in the history
…or-actions

change travis for github actionsa
  • Loading branch information
mvarlic authored Mar 7, 2023
2 parents 75c5e0a + 3c877f4 commit 9f4cb02
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 10 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/publish-lib.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

# GitHub recommends pinning actions to a commit SHA.
# To get a newer version, you will need to update the SHA.
# You can also reference a tag or branch, but the action may change without warning.

name: Publish Ruby Gem

on:
push:
tags:
- '*'

jobs:
build:
name: Build + Publish
runs-on: ubuntu-latest
permissions:
packages: write
contents: read

steps:
- uses: actions/checkout@v3
- name: Set up Ruby 2.4
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.4
- run: |
bundle install
- name: Publish to GPR
run: |
mkdir -p $HOME/.gem
touch $HOME/.gem/credentials
chmod 0600 $HOME/.gem/credentials
printf -- "---\n:github: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
gem build *.gemspec
gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} *.gem
env:
GEM_HOST_API_KEY: "Bearer ${{secrets.GITHUB_TOKEN}}"
OWNER: ${{ github.repository_owner }}

- name: Publish to RubyGems
run: |
mkdir -p $HOME/.gem
touch $HOME/.gem/credentials
chmod 0600 $HOME/.gem/credentials
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
gem build *.gemspec
gem push *.gem
env:
GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_API_KEY}}"
10 changes: 0 additions & 10 deletions .travis.yml

This file was deleted.

0 comments on commit 9f4cb02

Please sign in to comment.