Skip to content

Commit

Permalink
Merge pull request #314 from kpumuk/gha-release
Browse files Browse the repository at this point in the history
Added release workflow to automatically publish gems
  • Loading branch information
kpumuk authored Sep 20, 2024
2 parents c07041d + 3e6fad0 commit 10612c0
Show file tree
Hide file tree
Showing 9 changed files with 50 additions and 8 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Release

on:
workflow_dispatch:
inputs:
passphrase:
description: "Private key passphrase for signing the gem"
required: true

jobs:
push:
runs-on: ubuntu-latest

permissions:
contents: write
id-token: write
strategy:
fail-fast: true
matrix:
ruby-version:
- "3.2"
rails-version:
- "7.1"
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/rails_${{ matrix.rails-version }}.gemfile
environment: release
steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true
- name: Setup private key
env:
GEM_PRIVATE_KEY: ${{ secrets.GEM_PRIVATE_KEY }}
run: |
mkdir -p ~/.gem
echo "${GEM_PRIVATE_KEY}" > ~/.gem/gem-private_key.pem
- uses: rubygems/release-gem@v1
env:
GEM_PRIVATE_KEY_PASSPHRASE: "${{ inputs.passphrase }}"
2 changes: 1 addition & 1 deletion gemfiles/rails_6.0.gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: ..
specs:
meta-tags (2.22.0)
meta-tags (2.22.1.rc1)
actionpack (>= 6.0.0, < 8.1)

GEM
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rails_6.1.gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: ..
specs:
meta-tags (2.22.0)
meta-tags (2.22.1.rc1)
actionpack (>= 6.0.0, < 8.1)

GEM
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rails_7.0.gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: ..
specs:
meta-tags (2.22.0)
meta-tags (2.22.1.rc1)
actionpack (>= 6.0.0, < 8.1)

GEM
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rails_7.1.gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: ..
specs:
meta-tags (2.22.0)
meta-tags (2.22.1.rc1)
actionpack (>= 6.0.0, < 8.1)

GEM
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rails_7.2.gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: ..
specs:
meta-tags (2.22.0)
meta-tags (2.22.1.rc1)
actionpack (>= 6.0.0, < 8.1)

GEM
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rails_edge.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ GIT
PATH
remote: ..
specs:
meta-tags (2.22.0)
meta-tags (2.22.1.rc1)
actionpack (>= 6.0.0, < 8.1)

GEM
Expand Down
2 changes: 1 addition & 1 deletion lib/meta_tags/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

module MetaTags
# Gem version.
VERSION = "2.22.0"
VERSION = "2.22.1.rc1"
public_constant :VERSION
end
2 changes: 1 addition & 1 deletion meta-tags.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Gem::Specification.new do |spec|
spec.add_development_dependency "rspec_junit_formatter", "~> 0.6.0"

spec.cert_chain = ["certs/kpumuk.pem"]
spec.signing_key = File.expand_path("~/.ssh/gem-kpumuk.pem") if $PROGRAM_NAME.end_with?("gem")
spec.signing_key = File.expand_path("~/.gem/gem-private_key.pem") if $PROGRAM_NAME.end_with?("gem")

spec.metadata = {
"bug_tracker_uri" => "https://github.com/kpumuk/meta-tags/issues/",
Expand Down

0 comments on commit 10612c0

Please sign in to comment.