Skip to content

Commit 89af248

Browse files
bharat619zarakay
andauthored
[CHORE] Create workflow to auto publish a gem (#12)
* Create publish-gem.yml * Update name Co-authored-by: Zara Kay <[email protected]> Co-authored-by: Zara Kay <[email protected]>
1 parent 17a7ab2 commit 89af248

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

.github/workflows/publish-gem.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Ruby Gem
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
build:
9+
name: Build + Publish
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: Set up Ruby
15+
uses: actions/setup-ruby@v1
16+
with:
17+
ruby-version: .ruby-version
18+
bundler-cache: true
19+
20+
- name: Publish to GPR
21+
run: |
22+
mkdir -p $HOME/.gem
23+
touch $HOME/.gem/credentials
24+
chmod 0600 $HOME/.gem/credentials
25+
printf -- "---\n:github: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
26+
gem build *.gemspec
27+
gem push -V --key github --host https://rubygems.pkg.github.com/${OWNER} *.gem
28+
env:
29+
GEM_HOST_API_KEY: "Bearer ${{secrets.GITHUB_TOKEN}}"
30+
OWNER: ${{ github.repository_owner }}

0 commit comments

Comments
 (0)