-
Notifications
You must be signed in to change notification settings - Fork 29
48 lines (38 loc) · 1.02 KB
/
push_gem.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
name: Publish gem to rubygems.org
on:
push:
tags:
- 'v*'
permissions:
contents: read
jobs:
push:
if: github.repository == 'ruby/net-imap'
runs-on: ubuntu-latest
environment:
name: rubygems.org
url: https://rubygems.org/gems/net-imap
permissions:
contents: write
id-token: write
steps:
# Set up
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
ruby-version: ruby
# Release
- name: Publish to RubyGems
uses: rubygems/release-gem@v1
- name: Create GitHub release
run: |
tag_name="$(git describe --tags --abbrev=0)"
gh release create "${tag_name}" --verify-tag --draft --generate-notes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}