From 341f60ade994125d54b7d2264bbebd7a4ea372dc Mon Sep 17 00:00:00 2001 From: Matt Strapp Date: Thu, 31 Oct 2024 08:35:24 -0500 Subject: ci: Only run on version tag and use official action Signed-off-by: Matt Strapp --- .github/workflows/ruby.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 613eade..b359a28 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -27,7 +27,7 @@ jobs: - name: Set up Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: 3.3 + ruby-version: ruby bundler-cache: true - name: Build and test with Rake run: bundle exec rake @@ -49,7 +49,7 @@ jobs: - name: Set up Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: 3.3 + ruby-version: ruby bundler-cache: true - name: Build gem run: bundle exec rake build @@ -65,7 +65,8 @@ jobs: publish-release: name: Push gem to RubyGems.org needs: build-and-test - if: ${{ github.ref_type == 'tag' && startsWith(github.ref, 'refs/tags/') }} + # Only run on this on proper semver (vX.Y.Z) tags + if: ${{ github.ref_type == 'tag' && startsWith(github.ref_name, 'v') }} runs-on: ubuntu-latest permissions: id-token: write # IMPORTANT: this permission is mandatory for trusted publishing @@ -76,8 +77,8 @@ jobs: uses: ruby/setup-ruby@v1 with: bundler-cache: true - ruby-version: 3.3 + ruby-version: ruby - name: Build gem run: bundle exec rake build - name: Publish gem - run: gem push pkg/*.gem \ No newline at end of file + uses: rubygems/release-gem@v1 \ No newline at end of file -- cgit v1.2.3