From e2629a0c0a85aa05c7edaf3fbb9cfa0922eef6ee Mon Sep 17 00:00:00 2001 From: oscar Date: Fri, 15 May 2026 15:48:06 -0400 Subject: [PATCH 1/2] [DX-586] add release workflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Greenfield release workflow following the pattern shared with the other SDKs: workflow_dispatch with `bump` and `release-notes` inputs, gated to runs from `main`. The job runs rubocop + rspec (same checks as ci.yml), then: release/prepare → gem build + gem push → release/finalize `release/prepare` bumps lib/fintoc/version.rb and Gemfile.lock via the bump-ruby script. Commit, tag and GitHub Release are authored by `fin-releases[bot]` through the App. `gem push` uses the RUBYGEMS_API_KEY secret. The gem has `rubygems_mfa_required = true` so the API key must come from a RubyGems account with MFA enabled. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/release.yml | 55 +++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..4754b74 --- /dev/null +++ b/.github/workflows/release.yml @@ -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 }} From 5401828440a94a6691ed36cf0c8e479b90bfbd5e Mon Sep 17 00:00:00 2001 From: oscar Date: Fri, 15 May 2026 15:48:06 -0400 Subject: [PATCH 2/2] [DX-586] add RELEASING.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Documenta el flow nuevo: inputs del dispatch, qué hace cada step, y los caminos de recovery por escenario. Co-Authored-By: Claude Opus 4.7 (1M context) --- RELEASING.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 RELEASING.md diff --git a/RELEASING.md b/RELEASING.md new file mode 100644 index 0000000..a639652 --- /dev/null +++ b/RELEASING.md @@ -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` |