-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
18c75ed
commit 0f43ea3
Showing
4 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Test github action | ||
|
||
on: [pull_request] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
name: Ruby ${{ matrix.ruby }} | ||
strategy: | ||
matrix: | ||
ruby: | ||
- "3.0.6" | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: ${{ matrix.ruby }} | ||
bundler-cache: true | ||
- name: Test action in local workflow | ||
id: test-action | ||
uses: ./ | ||
with: | ||
github_token: xxxxx | ||
rubygems_api_key: xxxxx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Build and publish gem | ||
description: Publish gem in github packages and rubygems | ||
author: juliocabrera820 | ||
branding: | ||
icon: box | ||
color: black | ||
inputs: | ||
github_token: | ||
description: GitHub packages token | ||
required: false | ||
rubygems_api_key: | ||
description: Rubygems API key | ||
required: false | ||
github_username: | ||
description: Repository owner | ||
required: false | ||
default: ${{ github.repository_owner }} | ||
runs: | ||
using: composite | ||
steps: | ||
- run: ruby -W0 $GITHUB_ACTION_PATH/publish.rb | ||
shell: sh | ||
env: | ||
RUBYGEMS_API_KEY: ${{inputs.rubygems_api_key}} | ||
GITHUB_TOKEN: ${{inputs.github_token}} | ||
GITHUB_USERNAME: ${{inputs.github_username}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# frozen_string_literal: true | ||
|
||
# Module to handle credentials | ||
module Credentials | ||
RUBYGEMS_API_KEY = ENV['RUBYGEMS_API_KEY'] | ||
GITHUB_TOKEN = ENV['GITHUB_TOKEN'] | ||
GITHUB_USERNAME = ENV['GITHUB_USERNAME'] | ||
|
||
def self.print_credentials | ||
puts "RUBYGEMS_API_KEY: #{RUBYGEMS_API_KEY}" | ||
puts "GITHUB_TOKEN: #{GITHUB_TOKEN}" | ||
puts "GITHUB_USERNAME: #{GITHUB_USERNAME}" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
require_relative 'credentials' | ||
|
||
Credentials.print_credentials |