-
-
Notifications
You must be signed in to change notification settings - Fork 52
63 lines (61 loc) · 1.76 KB
/
release-ruby.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: Release Ruby
on:
push:
tags:
- 'ruby-v*' # Push events to matching ruby-v*, i.e. ruby-v1.0, ruby-v2.1.3
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
bundler-cache: true
working-directory: ./ruby
- run: bundle install
working-directory: ./ruby
- run: bundle exec rake
working-directory: ./ruby
publish:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
bundler-cache: true
working-directory: ./ruby
- name: Install and test
run: |
bundle install
bundle exec rake
working-directory: ./ruby
- name: Configure credentials
run: |
mkdir -p $HOME/.gem
touch $HOME/.gem/credentials
chmod 0600 $HOME/.gem/credentials
printf -- "---\n:rubygems_api_key: ${RUBYGEMS_API_KEY}" > $HOME/.gem/credentials
env:
RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
- name: Build gem
run: |
bundle exec rake build
working-directory: ./ruby
- name: Publish to rubygems.org
run: |
gem push pkg/asciidoctor-kroki-${GITHUB_REF#refs/tags/ruby-v}.gem
working-directory: ./ruby
# create the GitHub release
- name: Create release
id: create_release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: "💎 Ruby - ${{ github.ref }}"
draft: false
prerelease: false