-
Notifications
You must be signed in to change notification settings - Fork 0
33 lines (30 loc) · 935 Bytes
/
publish.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
---
name: Publish Rubygem
on:
push:
tags:
- 'v*'
jobs:
main:
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
- run: gem build bankrupt.gemspec
- name: setup credentials
run: |
mkdir -p $HOME/.gem
touch $HOME/.gem/credentials
chmod 0600 $HOME/.gem/credentials
printf -- "---\n:github: ${GH_API_KEY}\n" > $HOME/.gem/credentials
printf -- ":rubygems_api_key: ${RUBYGEMS_API_KEY}\n" >> $HOME/.gem/credentials
env:
GH_API_KEY: Bearer ${{ secrets.GITHUB_TOKEN }}
RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
- name: publish to rubygems
run: |
gem push *.gem
- name: publish to github packages
run: |
gem push --key github --host https://rubygems.pkg.github.com/${{ github.repository_owner }} *.gem