Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions .github/workflows/publish-gem.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
# This workflow is triggered when a GitHub release is created.
# It can also be run manually to re-publish to rubygems.org in case it failed for some reason.
# You can run this workflow by navigating to https://www.github.com/Hexlet/cloudpayments-ruby/actions/workflows/publish-gem.yml
# Manual fallback to (re-)publish a gem version to rubygems.org.
# The normal release flow publishes from the `release.yml` workflow's `publish` job.
# Run this manually only if that publish step needs to be retried for an existing release.
# Navigate to https://www.github.com/Hexlet/cloudpayments-ruby/actions/workflows/publish-gem.yml
name: Publish Gem
on:
workflow_dispatch:

release:
types: [published]

jobs:
publish:
name: publish
Expand Down
20 changes: 0 additions & 20 deletions .github/workflows/release-please.yml

This file was deleted.

50 changes: 50 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Release Please

on:
push:
branches:
- main

jobs:
release-please:
runs-on: ubuntu-latest
if: github.repository == 'Hexlet/cloudpayments-ruby'

permissions:
contents: write
pull-requests: write

outputs:
release_created: ${{ steps.release.outputs.release_created }}
version: ${{ steps.release.outputs.tag_name }}

steps:
- uses: googleapis/release-please-action@v5
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}
config-file: release-please-config.json
manifest-file: .release-please-manifest.json

publish:
needs: release-please
if: needs.release-please.outputs.release_created == 'true'
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v6

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: false

- run: |-
bundle install

- name: Publish to RubyGems.org
run: bash ./bin/publish-gem
env:
# `RUBYGEMS_HOST` is only required for private gem repositories, not https://rubygems.org
RUBYGEMS_HOST: ${{ secrets.CLOUDPAYMENTS_RUBYGEMS_HOST || secrets.RUBYGEMS_HOST }}
GEM_HOST_API_KEY: ${{ secrets.CLOUDPAYMENTS_GEM_HOST_API_KEY || secrets.GEM_HOST_API_KEY }}