chore: add publish gem version on github actions #1
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
name: Publish Gem | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
name: Ruby ${{ matrix.ruby }} | |
strategy: | |
matrix: | |
ruby: | |
- '3.2.2' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 3.2 | |
bundler-cache: true | |
- name: Install bundler | |
run: gem install bundler | |
- name: Install dependencies | |
run: bundle install | |
- name: Build gem | |
run: gem build lennarb.gemspec | |
- name: Push gem to RubyGems | |
env: | |
RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }} | |
run: | | |
gem push lennarb-*.gem |