Skip to content

fix: update release-please permissions (#33) #17

fix: update release-please permissions (#33)

fix: update release-please permissions (#33) #17

on:
push:
branches:
- main
name: Run Release Please
permissions:
contents: write
pull-requests: write
jobs:
release-please:
runs-on: ubuntu-latest
# Release-please creates a PR that tracks all changes
steps:
- uses: google-github-actions/release-please-action@v3
id: release
with:
token: ${{secrets.RELEASE_PLEASE_TOKEN}}
release-type: ruby
package-name: sorbet-schema
bump-minor-pre-major: true
bump-patch-for-minor-pre-major: true
version-file: "lib/sorbet-schema/version.rb"
outputs:
release_created: ${{ steps.release.outputs.release_created }}
release_tag_name: ${{ steps.release.outputs.tag_name }}
gem-release:
needs: release-please
runs-on: ubuntu-latest
if: ${{ needs.release-please.outputs.release_created }}
steps:
# The logic below handles the RubyGems publication:
- name: Checkout Repository
uses: actions/checkout@v4
with:
ref: ${{ needs.release-please.outputs.release_tag_name }}
# Set up Ruby if a release can be created.
- uses: ruby/setup-ruby@v1
- run: bundle install
- name: Release Gem
run: |
gem install bundler
bundle config unset deployment
bundle install
mkdir -p $HOME/.gem
touch $HOME/.gem/credentials
chmod 0600 $HOME/.gem/credentials
printf -- "---\n:rubygems_api_key: ${RUBY_GEM_API_TOKEN}\n" > $HOME/.gem/credentials
gem build *.gemspec
gem push *.gem
env:
RUBY_GEM_API_TOKEN: "${{secrets.RUBY_GEMS_PUSH_API_KEY}}"