Skip to content

fix(bench): guard filtered RStDev against a zero mean #469

fix(bench): guard filtered RStDev against a zero mean

fix(bench): guard filtered RStDev against a zero mean #469

---
# https://github.com/wayofdev/gh-actions/blob/master/.github/workflows/create-release.yml
# https://github.com/google-github-actions/release-please-action#release-types-supported
# https://github.com/googleapis/release-please/blob/main/docs/customizing.md
on: # yamllint disable-line rule:truthy
push:
branches:
- 1.x
# Manual re-trigger. release-please's post-merge run creates the GitHub
# release/tag by querying the search index for the just-merged release PR;
# if that index hasn't caught up yet the tag is skipped while the manifest
# is already bumped, which deadlocks future release PRs. This lets the run
# be retried without hacks (e.g. re-running a stale workflow run).
workflow_dispatch:
name: πŸ“¦ Create release
# Serialize release runs so a release-creation run is never interrupted or
# raced by another (e.g. a feature PR merged right before the release PR).
# Never cancel a run mid-tagging β€” that is what produces an untagged, merged
# release PR and stalls the pipeline.
concurrency:
group: release-please-${{ github.ref }}
cancel-in-progress: false
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: πŸŽ‰ Create release
uses: googleapis/release-please-action@v5
id: release
with:
token: ${{ secrets.RELEASE_TOKEN }}
config-file: .github/.release-please-config.json
manifest-file: resources/version.json
target-branch: 1.x
# Guard against the root-only release deadlock. release-please cannot tag
# a *combined* release PR whose body has a single, root (empty-component)
# entry: it falls back to branch-name component matching, the combined
# branch carries no component, so the root tag is silently skipped while
# the PR stays merged+pending β€” deadlocking every future release.
# We detect it structurally: on 1.x the manifest root version is only
# bumped by a merged release PR, so "manifest version has no tag" == that
# exact stuck state. When release-please tags correctly the tag exists
# and this step is a no-op.
- name: πŸ”– Guard β€” tag a root-only release release-please skipped
if: ${{ steps.release.outputs.prs_created != 'true' }}
env:
GH_TOKEN: ${{ secrets.RELEASE_TOKEN }}
run: |
set -euo pipefail
version=$(gh api \
"repos/${GITHUB_REPOSITORY}/contents/resources/version.json?ref=${GITHUB_REF_NAME}" \
-H "Accept: application/vnd.github.raw" --jq '."."')
if [ -z "${version}" ] || [ "${version}" = "null" ]; then
echo "No root version in manifest β€” nothing to guard."
exit 0
fi
if gh api "repos/${GITHUB_REPOSITORY}/git/ref/tags/${version}" >/dev/null 2>&1; then
echo "Tag ${version} already exists β€” release-please handled the root release."
exit 0
fi
echo "::warning::Root tag ${version} missing after release-please β€” recovering from the root-only release-PR deadlock."
# The merged-but-untagged release PR still carries 'autorelease: pending'.
pr=$(gh pr list --repo "${GITHUB_REPOSITORY}" \
--state merged --base "${GITHUB_REF_NAME}" \
--label "autorelease: pending" \
--json number,body --jq 'sort_by(.number) | last // empty')
number=$(echo "${pr}" | jq -r '.number // empty')
notes=$(echo "${pr}" | jq -r '.body // empty')
# Tag = the release-PR merge commit that triggered this run (release-please convention).
gh release create "${version}" \
--repo "${GITHUB_REPOSITORY}" \
--target "${GITHUB_SHA}" \
--title "${version}" \
--notes "${notes:-Release ${version}}"
# Flip the label so the next release-please run no longer sees an
# outstanding untagged PR. We hit the REST labels API directly rather
# than `gh pr edit`, which over-fetches reviewRequests via GraphQL and
# 403s on a fine-grained PAT ("Resource not accessible by personal
# access token ... reviewRequests").
# Non-fatal: the tag is the critical outcome; a label hiccup (e.g. a
# token permission gap) must not fail the run after the release exists.
if [ -n "${number}" ]; then
gh api --method POST "repos/${GITHUB_REPOSITORY}/issues/${number}/labels" \
-f "labels[]=autorelease: tagged" >/dev/null 2>&1 \
&& gh api --method DELETE \
"repos/${GITHUB_REPOSITORY}/issues/${number}/labels/autorelease%3A%20pending" \
>/dev/null 2>&1 \
|| echo "::notice::Tagged ${version} but could not update labels on PR #${number}; remove 'autorelease: pending' manually if it lingers."
fi
# Mirror the just-released versions into every testo/* constraint of the
# release PR. Re-applied on every run, so it survives release-please
# regenerating (force-pushing) the PR branch.
- name: ⬇️ Checkout release PR branch
if: ${{ steps.release.outputs.prs_created == 'true' }}
uses: actions/checkout@v7
with:
ref: ${{ fromJSON(steps.release.outputs.pr).headBranchName }}
token: ${{ secrets.RELEASE_TOKEN }}
fetch-depth: 0
- name: 🐘 Setup PHP
if: ${{ steps.release.outputs.prs_created == 'true' }}
uses: shivammathur/setup-php@v2
with:
php-version: 8.5
coverage: none
- name: πŸ”— Sync intra-package version constraints
if: ${{ steps.release.outputs.prs_created == 'true' }}
run: |
# Provide the base-branch manifest so the sync only refreshes
# testo/testo in packages actually released this cycle.
# NB: no --depth here. `git fetch --depth=1` re-shallows the full
# clone (writes .git/shallow, truncating history to one commit),
# which would later starve the Vibe Index step of git history and
# silently score it 0.0. The checkout above is fetch-depth: 0.
git fetch origin 1.x
git show FETCH_HEAD:resources/version.json > "${RUNNER_TEMP}/prev-version.json" \
|| cp resources/version.json "${RUNNER_TEMP}/prev-version.json"
php .github/release-please/sync-deps.php "${RUNNER_TEMP}/prev-version.json"
- name: 🎚️ Update Vibe Index badge
if: ${{ steps.release.outputs.prs_created == 'true' }}
uses: roxblnfk/action-vibe-index@master
with:
update-files: README.md
badge-style: flat
- name: πŸ“Œ Commit synced constraints & badge
if: ${{ steps.release.outputs.prs_created == 'true' }}
run: |
if git diff --quiet; then
echo "Nothing to commit (constraints and badge unchanged)."
exit 0
fi
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git commit -am "chore(release): sync version constraints and Vibe Index badge"
git push
...