Skip to content

Commit

Permalink
Fix release action
Browse files Browse the repository at this point in the history
  • Loading branch information
bastelfreak committed Nov 21, 2024
1 parent 7884d6d commit 324bc78
Showing 1 changed file with 24 additions and 16 deletions.
40 changes: 24 additions & 16 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,32 @@
name: Publish Gem
name: Release

on:
workflow_dispatch:
push:
tags:
- '*'

jobs:
build:
release:
runs-on: ubuntu-latest
permissions:
contents: write

if: github.repository_owner == 'voxpupuli'
steps:
- uses: actions/checkout@v4
- uses: fregante/setup-git-user@v2
- uses: ruby/setup-ruby@v1
- name: Install Ruby 3.3
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2.3
bundler-cache: true # runs 'bundle install' and caches installed gems automatically

- name: Release Gem
uses: cadwallion/publish-rubygems-action@master
ruby-version: '3.3'
env:
BUNDLE_WITHOUT: release:development:rubocop
- name: Build gem
run: gem build --verbose *.gemspec
- name: Publish gem to rubygems.org
run: gem push *.gem
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
RELEASE_COMMAND: bundle exec rake release
GEM_HOST_API_KEY: '${{ secrets.RUBYGEMS_AUTH_TOKEN }}'
- name: Setup GitHub packages access
run: |
mkdir -p ~/.gem
echo ":github: Bearer ${{ secrets.GITHUB_TOKEN }}" >> ~/.gem/credentials
chmod 0600 ~/.gem/credentials
- name: Publish gem to GitHub packages
run: gem push --key github --host https://rubygems.pkg.github.com/voxpupuli *.gem

0 comments on commit 324bc78

Please sign in to comment.