-
Notifications
You must be signed in to change notification settings - Fork 1
44 lines (38 loc) · 1014 Bytes
/
publish.yml
File metadata and controls
44 lines (38 loc) · 1014 Bytes
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
41
42
43
44
name: publish
on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
tag:
description: 'Version tag to publish (e.g. v1.0.0)'
required: true
permissions:
contents: read
jobs:
publish:
name: Publish to RubyGems
runs-on: ubuntu-latest
environment: rubygems
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Set up Ruby
uses: ruby/setup-ruby@c4e5b1316158f92e3d49443a9d58b31d25ac0f8f # v1.306.0
with:
ruby-version: .ruby-version
bundler-cache: true
- name: Build gem
run: gem build arcp.gemspec
- name: Publish to RubyGems
env:
GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
run: |
mkdir -p ~/.gem
printf -- "---\n:rubygems_api_key: %s\n" "$GEM_HOST_API_KEY" > ~/.gem/credentials
chmod 0600 ~/.gem/credentials
gem push arcp-*.gem
rm -f ~/.gem/credentials