Merge pull request #63 from aristotelesbr/development #8
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 | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
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: Set up RubyGems credentials | |
env: | |
RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }} | |
run: | | |
mkdir -p ~/.gem | |
echo -e "---\n:rubygems_api_key: $RUBYGEMS_API_KEY" > ~/.gem/credentials | |
chmod 0600 ~/.gem/credentials | |
- name: Push gem to RubyGems | |
env: | |
RUBYGEMS_HOST: "https://rubygems.org" | |
RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }} | |
run: | | |
cat ~/.gem/credentials | head -c 50 | |
ls *.gem | |
gem push $(ls *.gem) | |