.github/workflows/release.yml
name: Release Cfer
on:
workflow_dispatch:
inputs:
release_type:
type: choice
description: Type of release to run
required: true
options:
- major
- minor
- patch
jobs:
Publish:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1
bundler-cache: true
- run: bundle install --without debug --without test --jobs=3 --retry=3
- name: Bump version
run: |
git config --global user.name "CI"
git config --global user.email "seanedwards@users.noreply.github.com"
bundle exec bump ${{inputs.release_type}} --tag --tag-prefix v --changelog
git merge v$(bundle exec bump current)
git push --follow-tags
- name: Publish to RubyGems
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.RUBYGEMS_API_KEY}}"