Skip to content
Draft
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
55 changes: 55 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Release

on:
workflow_dispatch:
inputs:
bump:
description: 'Tipo de bump'
type: choice
required: true
default: minor
options: [patch, minor, major]
release-notes:
description: 'Release notes (markdown, opcional)'
type: string
required: false

jobs:
release:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4

- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2.2'
bundler-cache: true

- run: bundle exec rubocop
- run: bundle exec rspec

- uses: fintoc-com/release-action/prepare@main
id: prep
with:
bump: ${{ inputs.bump }}
version-format: ruby
tag-prefix: v
app-id: ${{ vars.FIN_RELEASES_APP_ID }}
app-private-key: ${{ secrets.FIN_RELEASES_PRIVATE_KEY }}

- name: Build and push gem
env:
GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
run: |
gem build *.gemspec
gem push *.gem

- uses: fintoc-com/release-action/finalize@main
with:
tag: ${{ steps.prep.outputs.tag }}
release-notes: ${{ inputs.release-notes }}
app-id: ${{ vars.FIN_RELEASES_APP_ID }}
app-private-key: ${{ secrets.FIN_RELEASES_PRIVATE_KEY }}
25 changes: 25 additions & 0 deletions RELEASING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Releasing

Manual desde Actions. Toma ~3–4 min.

## Cómo

1. https://github.com/fintoc-com/fintoc-ruby/actions → **Release** → **Run workflow**.
2. `bump`: `patch` / `minor` / `major`. `release-notes`: markdown opcional.
3. **Run workflow**. Solo corre desde `main`.

## Qué hace

`bundle install` + `rubocop` + `rspec` →
[`release/prepare`](https://github.com/fintoc-com/release-action/tree/main/prepare) bumpea `lib/fintoc/version.rb` (y refresca `Gemfile.lock`) →
`gem build *.gemspec` + `gem push *.gem` (con `RUBYGEMS_API_KEY`) →
[`release/finalize`](https://github.com/fintoc-com/release-action/tree/main/finalize) pushea commit + tag, crea GitHub Release.

Todo autoreado por `fin-releases[bot]`.

## Si falla

| Falla en | Estado | Recovery |
|---|---|---|
| Antes o durante `gem push` | Nada en el remote | Re-run |
| `release/finalize` (post-publish) | Gem en RubyGems, sin tag/release | PR con el commit del bump + `gh release create vX.Y.Z` |
Loading