Skip to content

Commit

Permalink
chore: Update GitHub Actions workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
kylewelsby committed Jun 28, 2024
1 parent 7b2bc07 commit d550bca
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 37 deletions.
34 changes: 32 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ on:
push:
branches:
- main
tags:
- 'v*'
pull_request:
branches:
- main
release:
types:
- published

jobs:
lint:
Expand Down Expand Up @@ -51,3 +52,32 @@ jobs:
run: bundle install
- name: Run tests 🧪
run: bundle exec ruby -Ilib test/*.rb
publish:
if: github.event_name == 'release' && github.event.action == 'published'
needs: test
name: Build and Publish Gem 🚀
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3
- name: Install dependencies 📦
run: |
echo 'gem: --no-document' >> ~/.gemrc
gem install bundler
bundle install
- name: Build Gem 📦
run: gem build *.gemspec
- name: Publish Gem 🚀
run: |
mkdir -p $HOME/.gem
touch $HOME/.gem/credentials
chmod 0600 $HOME/.gem/credentials
printf -- "---\n:rubygems_api_key: ${RUBYGEMS_API_KEY}" > $HOME/.gem/credentials
gem push *.gem
env:
RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}



35 changes: 0 additions & 35 deletions .github/workflows/publish.yml

This file was deleted.

0 comments on commit d550bca

Please sign in to comment.