Release Gem #51
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This manual workflow build and push the gem to rubygems and creates a release tag at the current master commit | |
name: Release Gem | |
on: | |
workflow_dispatch: | |
jobs: | |
release-gem: | |
environment: release | |
runs-on: ubuntu-latest | |
env: | |
BUNDLE_GEMFILE: .github/gemfiles/default | |
steps: | |
- uses: actions/checkout@v4 # checks out default branch | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '3.0' | |
- run: bundle install | |
- name: Dotenv Action | |
id: dotenv | |
uses: falti/[email protected] | |
with: | |
path: .github/.env | |
- name: Build and push | |
run: | | |
mkdir -p $HOME/.gem | |
printf -- "---\n:rubygems_api_key: ${RUBYGEMS_TOKEN}\n" > $HOME/.gem/credentials | |
chmod 0600 $HOME/.gem/credentials | |
gem build ${{ steps.dotenv.outputs.gem }}.gemspec | |
gem push ${{ steps.dotenv.outputs.gem }}-*.gem | |
env: | |
RUBYGEMS_TOKEN: ${{ secrets.RUBYGEMS_TOKEN }} | |
- name: Create the release tag | |
uses: rickstaa/[email protected] | |
with: | |
tag: ${{ steps.dotenv.outputs.version }} |