Skip to content

Commit 209621a

Browse files
authored
Merge pull request #16 from nobu/push_gem
Add push_gem.yml
2 parents 4d806cc + dedf471 commit 209621a

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

.github/workflows/push_gem.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Publish gem to rubygems.org
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
push:
13+
if: startsWith(github.repository, 'ruby')
14+
runs-on: ubuntu-latest
15+
16+
environment:
17+
name: rubygems.org
18+
url: https://rubygems.org/gems/date
19+
20+
permissions:
21+
contents: write
22+
id-token: write
23+
24+
strategy:
25+
matrix:
26+
ruby: 3.4
27+
28+
steps:
29+
- name: Harden Runner
30+
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
31+
with:
32+
egress-policy: audit
33+
34+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
35+
36+
- name: Set up Ruby
37+
uses: ruby/setup-ruby@eaecf785f6a34567a6d97f686bbb7bccc1ac1e5c # v1.237.0
38+
with:
39+
bundler-cache: true
40+
ruby-version: ${{ matrix.ruby }}
41+
42+
- name: Publish to RubyGems
43+
uses: rubygems/release-gem@a25424ba2ba8b387abc8ef40807c2c85b96cbe32 # v1.1.1
44+
45+
- name: Create GitHub release
46+
run: |
47+
tag_name="$(git describe --tags --abbrev=0)"
48+
gh release create "${tag_name}" --verify-tag --generate-notes
49+
env:
50+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)