Skip to content

Commit

Permalink
build: add release-please action for releasing to RubyGems (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewmcodes authored Apr 3, 2022
1 parent 3421f32 commit 3367a76
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Publish

on:
push:
branches:
- main

jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: GoogleCloudPlatform/release-please-action@v3
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}
release-type: ruby
package-name: redaction
bump-minor-pre-major: true
version-file: "lib/redaction/version.rb"
- uses: actions/checkout@v2
if: ${{ steps.release.outputs.release_created }}
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1.0
if: ${{ steps.release.outputs.release_created }}
- run: |
gem install bundler -v 2.3.3
bundle install
bin/test
if: ${{ steps.release.outputs.release_created }}
- name: release gem
run: |
mkdir -p $HOME/.gem
touch $HOME/.gem/credentials
chmod 0600 $HOME/.gem/credentials
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
gem build *.gemspec
gem push *.gem
env:
GEM_HOST_API_KEY: "${{secrets.GEM_HOST_API_KEY}}"
if: ${{ steps.release.outputs.release_created }}

0 comments on commit 3367a76

Please sign in to comment.