forked from urvin-compliance/caracal
-
Notifications
You must be signed in to change notification settings - Fork 1
40 lines (33 loc) · 936 Bytes
/
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
38
39
40
name: Publish RubyGem
on:
release:
types:
- released
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2'
bundler-cache: true
- name: Tests
run: |
bundle exec rspec
- name: Build and publish gem
run: |
mkdir -p ~/.gem
cat << EOF > ~/.gem/credentials
---
:github: Bearer ${GITHUB_TOKEN}
:rubygems_api_key: ${RUBYGEMS_API_KEY}
EOF
chmod 0600 ~/.gem/credentials
find . -name '*.gemspec' -maxdepth 1 -exec gem build {} \;
find . -name '*.gem' -maxdepth 1 -print0 | xargs -0 gem push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RUBYGEMS_API_KEY: ${{secrets.RUBYGEMS_API_KEY}}
RELEASE_COMMAND: rake release