This repository has been archived by the owner on Feb 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Straightforward addition of a publish workflow that builds and pushes gem artifacts when a new GitHub Release is created.
- Loading branch information
Showing
1 changed file
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Publish | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
ci: | ||
name: CI | ||
uses: ./.github/workflows/ci.yml | ||
publish-to-rubygems: | ||
name: Publish to RubyGems | ||
permissions: | ||
contents: write | ||
id-token: write | ||
needs: ci | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
bundler-cache: true | ||
- uses: rubygems/release-gem@v1 | ||
with: | ||
await-release: false | ||
publish-to-github-packages: | ||
name: Publish to GitHub Packages | ||
permissions: | ||
contents: read | ||
packages: write | ||
needs: ci | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
bundler-cache: true | ||
- run: | | ||
mkdir -p $HOME/.gem | ||
touch $HOME/.gem/credentials | ||
chmod 0600 $HOME/.gem/credentials | ||
printf -- "---\n:github: Bearer ${{ secrets.GITHUB_TOKEN }}\n" > $HOME/.gem/credentials | ||
- run: bundle exec rake release | ||
env: | ||
BUNDLE_GEM__PUSH_KEY: github | ||
RUBYGEMS_HOST: "https://rubygems.pkg.github.com/${{ github.repository_owner }}" |