-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathaction.yml
35 lines (30 loc) · 948 Bytes
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: Publish gem
description: Publishes RubyGem to GitHub Packages
inputs:
gemspec-file:
description: Name of the gemspec file
required: false
default: "*.gemspec"
working-directory:
description: Path of the gem, usually containing the gemspec file
required: false
default: "."
runs:
using: composite
steps:
- name: Create ~/.gem/crendentials file
shell: bash
run: |
mkdir -p $HOME/.gem
echo -e "---\n:github: Bearer ${{ github.token }}" > $HOME/.gem/credentials
chmod 0600 $HOME/.gem/credentials
- name: Build gem
shell: bash
working-directory: ${{ inputs.working-directory }}
run: |
gem build ${{ inputs.gemspec-file }}
- name: Publish gem
shell: bash
working-directory: ${{ inputs.working-directory }}
run: |
gem push *.gem --key github --host https://rubygems.pkg.github.com/${{ github.repository_owner }}