Skip to content

Commit

Permalink
add GitHub release workflow (#28)
Browse files Browse the repository at this point in the history
using RubyGems Trusted Publishers
  • Loading branch information
ccutrer authored Feb 12, 2024
1 parent 6b0b896 commit 40ff2af
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Release a New Version

on:
workflow_dispatch:
inputs:
version:
description: "New Version. major|minor|patch|rc or an explicit version number."
required: true
default: patch
type: string

permissions:
contents: write

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true

jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
outputs:
new_version: ${{ steps.bump_version.outputs.new_version }}
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: git-actions/set-user@v1
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2
bundler-cache: true
rubygems: latest
- name: Bump version
id: bump_version
env:
GH_TOKEN: ${{ github.token }}
run: |
bundle config unset deployment
bundle exec gem bump -v ${{ inputs.version }} -m "v%{version}"
bundle install
git add Gemfile.lock Gemfile.ruby-2.6.lock
git commit --amend --no-edit
- uses: rubygems/release-gem@v1
2 changes: 2 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ GEM
irb (~> 1.10)
reline (>= 0.3.8)
diff-lcs (1.5.0)
gem-release (2.2.2)
io-console (0.7.2)
irb (1.11.0)
rdoc
Expand Down Expand Up @@ -91,6 +92,7 @@ PLATFORMS
DEPENDENCIES
bundler-multilock!
debug (~> 1.9)
gem-release (~> 2.2)
irb (~> 1.11)
rake (~> 13.0)
rspec (~> 3.12)
Expand Down
2 changes: 2 additions & 0 deletions Gemfile.ruby-2.6.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ GEM
irb (>= 1.5.0)
reline (>= 0.3.1)
diff-lcs (1.5.0)
gem-release (2.2.2)
io-console (0.7.2)
irb (1.6.3)
reline (>= 0.3.0)
Expand Down Expand Up @@ -42,6 +43,7 @@ PLATFORMS
DEPENDENCIES
bundler-multilock!
debug (= 1.8.0)
gem-release (~> 2.2)
irb (= 1.6.3)
rake (~> 13.0)
rspec (~> 3.12)
Expand Down
1 change: 1 addition & 0 deletions bundler-multilock.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Gem::Specification.new do |spec|

spec.add_dependency "bundler", ">= 2.4.19", "< 2.6"

spec.add_development_dependency "gem-release", "~> 2.2"
spec.add_development_dependency "rake", "~> 13.0"
spec.add_development_dependency "rspec", "~> 3.12"
end

0 comments on commit 40ff2af

Please sign in to comment.