Skip to content

Commit 9f4cb02

Browse files
authored
Merge pull request #82 from TransbankDevelopers/chore/change-travis-for-actions
change travis for github actionsa
2 parents 75c5e0a + 3c877f4 commit 9f4cb02

File tree

2 files changed

+55
-10
lines changed

2 files changed

+55
-10
lines changed

Diff for: .github/workflows/publish-lib.yml

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
6+
# GitHub recommends pinning actions to a commit SHA.
7+
# To get a newer version, you will need to update the SHA.
8+
# You can also reference a tag or branch, but the action may change without warning.
9+
10+
name: Publish Ruby Gem
11+
12+
on:
13+
push:
14+
tags:
15+
- '*'
16+
17+
jobs:
18+
build:
19+
name: Build + Publish
20+
runs-on: ubuntu-latest
21+
permissions:
22+
packages: write
23+
contents: read
24+
25+
steps:
26+
- uses: actions/checkout@v3
27+
- name: Set up Ruby 2.4
28+
uses: ruby/setup-ruby@v1
29+
with:
30+
ruby-version: 2.4
31+
- run: |
32+
bundle install
33+
34+
- name: Publish to GPR
35+
run: |
36+
mkdir -p $HOME/.gem
37+
touch $HOME/.gem/credentials
38+
chmod 0600 $HOME/.gem/credentials
39+
printf -- "---\n:github: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
40+
gem build *.gemspec
41+
gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} *.gem
42+
env:
43+
GEM_HOST_API_KEY: "Bearer ${{secrets.GITHUB_TOKEN}}"
44+
OWNER: ${{ github.repository_owner }}
45+
46+
- name: Publish to RubyGems
47+
run: |
48+
mkdir -p $HOME/.gem
49+
touch $HOME/.gem/credentials
50+
chmod 0600 $HOME/.gem/credentials
51+
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
52+
gem build *.gemspec
53+
gem push *.gem
54+
env:
55+
GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_API_KEY}}"

Diff for: .travis.yml

-10
This file was deleted.

0 commit comments

Comments
 (0)