Skip to content

Commit f14a7a3

Browse files
committed
Add push.yml workflow for RubyGems trusted publishing
Also fix gemspec changelog reference from CHANGES.md to CHANGELOG.md.
1 parent f7c5f88 commit f14a7a3

2 files changed

Lines changed: 41 additions & 2 deletions

File tree

.github/workflows/push.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Push gem to RubyGems
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
push:
13+
if: github.repository == 'httprb/form_data'
14+
runs-on: ubuntu-latest
15+
16+
environment:
17+
name: rubygems.org
18+
url: https://rubygems.org/gems/http-form_data
19+
20+
permissions:
21+
contents: write
22+
id-token: write
23+
24+
steps:
25+
- uses: actions/checkout@v6
26+
27+
- uses: ruby/setup-ruby@v1
28+
with:
29+
ruby-version: ruby
30+
bundler-cache: true
31+
32+
- uses: rubygems/release-gem@v1
33+
34+
- name: Create GitHub release
35+
run: |
36+
tag_name="$(git describe --tags --abbrev=0)"
37+
gh release create "${tag_name}" --verify-tag --generate-notes
38+
env:
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

http-form_data.gemspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ Gem::Specification.new do |spec|
2121
spec.metadata["homepage_uri"] = spec.homepage
2222
spec.metadata["source_code_uri"] = "#{spec.homepage}/tree/v#{spec.version}"
2323
spec.metadata["bug_tracker_uri"] = "#{spec.homepage}/issues"
24-
spec.metadata["changelog_uri"] = "#{spec.homepage}/blob/v#{spec.version}/CHANGES.md"
24+
spec.metadata["changelog_uri"] = "#{spec.homepage}/blob/v#{spec.version}/CHANGELOG.md"
2525
spec.metadata["documentation_uri"] = "https://www.rubydoc.info/gems/http-form_data/#{spec.version}"
2626
spec.metadata["rubygems_mfa_required"] = "true"
2727

2828
spec.files = IO.popen(%w[git ls-files -z], chdir: __dir__, err: IO::NULL) do |ls|
29-
extras = %w[CHANGES.md LICENSE.txt README.md] << File.basename(__FILE__)
29+
extras = %w[CHANGELOG.md LICENSE.txt README.md] << File.basename(__FILE__)
3030

3131
ls.readlines("\x0", chomp: true).select do |f|
3232
f.start_with?("lib/", "sig/") || extras.include?(f)

0 commit comments

Comments
 (0)