-
Notifications
You must be signed in to change notification settings - Fork 93
42 lines (40 loc) · 1.17 KB
/
release.yml
File metadata and controls
42 lines (40 loc) · 1.17 KB
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
name: Release
on:
push:
tags:
- '*.*.*'
workflow_dispatch:
jobs:
build:
name: Build and Release
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@a6b46b8a08edb18935835849f2a17072d5cc8c73 # v1.192.0
with:
ruby-version: '2.6'
- run: bundle install
- name: Publish to GPR
env:
GEM_HOST_API_KEY: "Bearer ${{secrets.GITHUB_TOKEN}}"
run: |
mkdir -p $HOME/.gem
touch $HOME/.gem/credentials
chmod 0600 $HOME/.gem/credentials
printf -- "---\n:github: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
gem build *.gemspec
if [ ${{ github.ref_type }} == "tag" ]; then
gem push --verbose \
--key github \
--host https://rubygems.pkg.github.com/${{ github.repository_owner }} \
*.gem
fi
- name: Upload gem as action artifact
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874
if: ${{ always() }}
with:
path: ./*.gem