argoyle 51b3b980a3 fix(release): make Release.yml robust to curl exit codes (#23)
## Why

After #22 moved the branch-readiness poll before `.version` write, the workflow started failing **every run** with `exitcode '23'` and no error output. Exit 23 = `CURLE_WRITE_ERROR` from curl in the wait loop's `BRANCH_STATUS=$(curl ...)`. With `set -e`, any non-zero status from a command substitution aborts the script before the retry/echo path runs — so the failure was both deterministic and silent.

## Changes

- Introduce an `api_call` helper that wraps curl with `|| rc=$?` and emits `<http_code>|<curl_rc>` plus the response body. Curl exit codes can no longer kill the script via `set -e`.
- Create the `next-release` branch explicitly via `POST /branches` instead of relying on the `new_branch` parameter of the CHANGELOG.md PUT. Eliminates the race between branch creation and subsequent file writes.
- Poll branch readiness after explicit creation.
- Fetch file blob SHAs from `next-release` directly (not base), so writes always carry the correct SHA.
- Every API call (branch create, CHANGELOG.md, .version, PR) now retries 5× with HTTP code, curl exit code, and response body logged on failure.

## Test plan

- [ ] Trigger Release.yml on a repo with a pending changelog entry; confirm branch is created, both files written, and PR opened.
- [ ] On transient errors, log shows HTTP code + curl rc + body on each retry.

Reviewed-on: #23
2026-05-13 10:53:38 +00:00

Shared Workflows

Reusable Gitea Actions workflows for Unbound Software repositories.

Available Workflows

Release.yml

Automated release workflow using git-cliff for changelog generation.

Usage:

name: Release

on:
  push:
    branches: [main]

jobs:
  release:
    uses: unboundsoftware/shared-workflows/.gitea/workflows/Release.yml@main

Inputs:

  • tag_only (boolean, default: false): Set to true to only create tags without full releases

Requirements:

This workflow reads the release token from /runner-secrets/release-token, which is automatically available on Unbound's Gitea runners. No repository secrets need to be configured.

How it works:

  1. On each push to the default branch, generates a changelog using git-cliff
  2. Creates or updates a next-release branch with the updated CHANGELOG.md and .version file
  3. Opens or updates a PR titled "chore(release): prepare for vX.Y.Z"
  4. When the .version file exists (after merging the release PR), creates a Gitea release with the changelog
S
Description
No description provided
Readme 102 KiB
Languages
Markdown 100%