-
Notifications
You must be signed in to change notification settings - Fork 32
62 lines (49 loc) · 1.59 KB
/
push_gem.yml
File metadata and controls
62 lines (49 loc) · 1.59 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Publish gem to rubygems.org
on:
push:
tags:
- 'v*'
permissions:
contents: read
jobs:
push:
if: github.repository == 'ruby/digest'
runs-on: ubuntu-latest
environment:
name: rubygems.org
url: https://rubygems.org/gems/digest
permissions:
contents: write
id-token: write
strategy:
matrix:
ruby: ["3.3", "jruby"]
steps:
- name: Harden Runner
uses: step-security/harden-runner@f808768d1510423e83855289c910610ca9b43176 # v2.17.0
with:
egress-policy: audit
- uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98 # v5.0.1
- name: Set up Ruby
uses: ruby/setup-ruby@d5126b9b3579e429dd52e51e68624dda2e05be25 # v1.267.0
with:
ruby-version: ${{ matrix.ruby }}
# https://github.com/rubygems/rubygems/issues/5882
- name: Install dependencies and build for JRuby
run: |
sudo apt install default-jdk maven
gem update --system
gem install ruby-maven rake-compiler --no-document
rake compile
if: matrix.ruby == 'jruby'
- name: Install dependencies
run: bundle install --jobs 4 --retry 3
- name: Publish to RubyGems
uses: rubygems/release-gem@6317d8d1f7e28c24d28f6eff169ea854948bd9f7 # v1.2.0
- name: Create GitHub release
run: |
tag_name="$(git describe --tags --abbrev=0)"
gh release create "${tag_name}" --verify-tag --generate-notes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: matrix.ruby != 'jruby'