From 8cdce9ec37374f878f130e0fef9225e909c155af Mon Sep 17 00:00:00 2001 From: Dmitry Ilyin <6576495+widgetii@users.noreply.github.com> Date: Thu, 21 May 2026 09:38:57 +0300 Subject: [PATCH] ci/build-one: accept arbitrary commit input; publish to nightly-bisect-* tag build-one.yml gains an optional `commit` workflow_dispatch input. When present, the checkout step pulls that ref and the resulting release is tagged `nightly-bisect-` (prerelease). When absent, the workflow falls back to building HEAD and tags as `nightly-bisect--` so repeated one-offs of the same HEAD don't collide. The tag namespace `nightly-bisect-*` is deliberately distinct from nightly-YYYYMMDD- (the daily scheduled releases produced by build.yml) so: - one-off bisect rebuilds don't pollute the dated nightly index (enrich_manifest.py filters strictly on the dated naming pattern, so nightly-bisect-* releases never enter manifest.{json,flat}) - the retention sweep (cleanup.yml) leaves them alone (same regex) This is what enables `git bisect run` to invoke gh workflow run build-one.yml -f platform=X -f commit= for sub-nightly granularity. Combined with the upcoming contrib/ openipc-bisect host driver, that gives a full bisect loop down to a single commit when daily granularity isn't enough. Also bumped the retry budget to match #2115 (30 60 120 300 600 1200) since build-one shares the same upstream-CDN flake exposure as the matrix build. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/build-one.yml | 45 +++++++++++++++++++++++++++++---- 1 file changed, 40 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-one.yml b/.github/workflows/build-one.yml index 02fbd21ef1..4bd2be1591 100644 --- a/.github/workflows/build-one.yml +++ b/.github/workflows/build-one.yml @@ -5,18 +5,44 @@ on: platform: description: 'Platform to build (e.g. hi3516cv100_lite)' required: true - -env: - TAG_NAME: latest + commit: + description: 'Commit SHA to build (optional; defaults to current branch HEAD). Use this from `git bisect run` or for one-off historic rebuilds.' + required: false jobs: + resolve: + name: Resolve commit + runs-on: ubuntu-latest + outputs: + ref: ${{ steps.r.outputs.ref }} + short_sha: ${{ steps.r.outputs.short_sha }} + tag_name: ${{ steps.r.outputs.tag_name }} + steps: + - id: r + run: | + REF="${{ inputs.commit }}" + [ -z "$REF" ] && REF="${{ github.sha }}" + SHORT="$(printf '%s' "$REF" | cut -c1-7)" + if [ -n "${{ inputs.commit }}" ]; then + TAG="nightly-bisect-${SHORT}" + else + TAG="nightly-bisect-${SHORT}-$(date -u +%Y%m%d%H%M%S)" + fi + echo "ref=$REF" >> "$GITHUB_OUTPUT" + echo "short_sha=$SHORT" >> "$GITHUB_OUTPUT" + echo "tag_name=$TAG" >> "$GITHUB_OUTPUT" + echo "Building ${{ inputs.platform }} at $REF -> release tag $TAG" + buildroot: name: Firmware (${{inputs.platform}}) + needs: resolve runs-on: ubuntu-latest steps: - name: Checkout source uses: actions/checkout@v4 + with: + ref: ${{ needs.resolve.outputs.ref }} - name: Prepare firmware run: | @@ -37,6 +63,9 @@ jobs: restore-keys: dl- - name: Build firmware + env: + BUILD_ID: ${{ needs.resolve.outputs.tag_name }} + BUILD_SHA: ${{ needs.resolve.outputs.ref }} run: | export GIT_HASH=$(git rev-parse --short ${GITHUB_SHA}) export GIT_BRANCH=${GITHUB_REF_NAME} @@ -46,7 +75,7 @@ jobs: mkdir -p /tmp/ccache ln -s /tmp/ccache ${HOME}/.ccache - backoffs="30 60 120 300" + backoffs="30 60 120 300 600 1200" attempt=1 for sleep_for in $backoffs ""; do make BOARD=${{inputs.platform}} && break @@ -78,7 +107,13 @@ jobs: - name: Upload firmware uses: softprops/action-gh-release@v2 with: - tag_name: ${{env.TAG_NAME}} + tag_name: ${{ needs.resolve.outputs.tag_name }} + prerelease: true + body: | + sha=${{ needs.resolve.outputs.ref }} + short=${{ needs.resolve.outputs.short_sha }} + platform=${{ inputs.platform }} + one_off=true files: | ${{env.NORFW}} ${{env.NANDFW}}