Skip to content

adds publishing workflow #1

adds publishing workflow

adds publishing workflow #1

Workflow file for this run

name: Publish
on:
push:
tags:
- '*'
jobs:
publish:
runs-on: ubuntu-latest
strategy:
matrix:
ruby:
- '3.0'
- '3.1'
- '3.2'
- '3.3'
permissions:
contents: write # Required for `rake release` to push the release tag
id-token: write # Required for trusted publishing
packages: write # Required for publishing to GitHub Package Registry
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- name: Publish to GitHub Packages
env:
GEM_HOST_API_KEY: "Bearer ${{ secrets.GITHUB_TOKEN }}"
OWNER: ${{ github.repository_owner }}
run: |
mkdir -pv $HOME/.gem
touch $HOME/.gem/credentials
chmod 0600 $HOME/.gem/credentials
printf -- "---\n:github: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
gem build *.gemspec
gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} *.gem