Skip to content

Commit

Permalink
adds publishing workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
vlj91 committed Feb 9, 2024
1 parent fbd096d commit f19d5bb
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
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
1 change: 1 addition & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ GEM
unicode-display_width (2.5.0)

PLATFORMS
x86_64-darwin-21
x86_64-linux

DEPENDENCIES
Expand Down

0 comments on commit f19d5bb

Please sign in to comment.