-
Notifications
You must be signed in to change notification settings - Fork 3
37 lines (36 loc) · 1.23 KB
/
publish-gem.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
36
37
name: Build and Release gem
on:
release:
types: [published]
jobs:
release:
name: Release to gem hosts
runs-on: ubuntu-latest
steps:
- name: Setup ruby
uses: actions/setup-ruby@v1
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: git fetch origin +refs/tags/*:refs/tags/*
- name: Setup credentials and versioning
run: |
gem install keycutter
mkdir -p $HOME/.gem
touch $HOME/.gem/credentials
chmod 0600 $HOME/.gem/credentials
printf -- "---\n:rubygems_api_key: ${RUBYGEMS_API_KEY}\n" > $HOME/.gem/credentials
printf -- ":github: Bearer ${GPR_API_KEY}\n" >> $HOME/.gem/credentials
env:
RUBYGEMS_API_KEY: ${{secrets.RUBYGEMS_AUTH_TOKEN}}
GPR_API_KEY: ${{secrets.GITHUB_TOKEN}}
- name: Build emass_client
run: gem build -C src/ruby_client/ emass_client.gemspec
- name: Publish to RubyGems
run: |
gem push --KEY rubygems --host https://rubygems.org src/ruby_client/*.gem
- name: Publish to GPR
run: |
gem push --KEY github --host https://rubygems.pkg.github.com/mitre src/ruby_client/*.gem
env:
OWNER: mitre