From fef4dbaaacf233440116b72ecc980c0735982583 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Thu, 3 Dec 2026 11:33:34 -0800 Subject: [PATCH] ci: publish block releases from hosted runners The release job holds contents: write and packages: write and logs in to GHCR, and builds its images with the runner's Docker. Following BLOCK_RUNNER_LABEL put it on the persistent pool that same-repository PR test jobs also use, whose Docker and build cache those jobs can leave state in, and whose Docker setup is still listed as unvalidated. The source repository published from ubuntu-latest; keep that. Co-Authored-By: Claude Opus 5.5 --- .github/block/README.md | 2 +- .github/block/scripts/block-ci-port-test.py | 5 ++--- .github/workflows/block-release.yml | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/block/README.md b/.github/block/README.md index 3641c329be..1652a1e79e 100644 --- a/.github/block/README.md +++ b/.github/block/README.md @@ -2,7 +2,7 @@ The block module stays in `seaweed-block/` with its own `go.mod` and unchanged module path. Root `block-*.yml` workflows run shell commands there; action inputs name the subdirectory explicitly. The imported subtree is unchanged: every port file lives under root `.github/`. Existing module scripts and data remain base-owned inputs; only the Git adapters and unit-group coordinator live in root `.github/block/scripts/`. The existing nested workflows are inert because GitHub only discovers root workflows. -PR and master-push workflows select `seaweed-block/**` and their root block workflow files. All jobs default to `ubuntu-latest`. Set the repository variable `BLOCK_RUNNER_LABEL` only after the corresponding dedicated runner label is registered and available; same-repository/trusted events of the test, spec-trace and known-bugs jobs then use that label. The post-merge-review paths check always runs hosted. Fork PRs always use GitHub-hosted runners. GitHub Actions cannot fall back after requesting an unavailable label, so an unset variable is the explicit safe default. Unset it again if the registered pool is withdrawn. Runner discovery would require runner-management API access that the read-only workflow token does not have; no new credential is requested. +PR and master-push workflows select `seaweed-block/**` and their root block workflow files. All jobs default to `ubuntu-latest`. Set the repository variable `BLOCK_RUNNER_LABEL` only after the corresponding dedicated runner label is registered and available; same-repository/trusted events of the test, spec-trace and known-bugs jobs then use that label. The post-merge-review paths check and the release always run hosted. Fork PRs always use GitHub-hosted runners. GitHub Actions cannot fall back after requesting an unavailable label, so an unset variable is the explicit safe default. Unset it again if the registered pool is withdrawn. Runner discovery would require runner-management API access that the read-only workflow token does not have; no new credential is requested. The unit check keeps `go test (linux)` and `process-level tests (real binaries)` under workflow `Block Test`. Module-relative diff/blob adapters preserve the block model map and allow list. Root block workflow/Docker recipe changes still pass the block trace/public-text checks; unrelated host code is excluded. No imported module paths or product formats change. diff --git a/.github/block/scripts/block-ci-port-test.py b/.github/block/scripts/block-ci-port-test.py index 770a51df77..ea35dc60b8 100644 --- a/.github/block/scripts/block-ci-port-test.py +++ b/.github/block/scripts/block-ci-port-test.py @@ -53,9 +53,8 @@ class PortTests(unittest.TestCase): self.assertIn('docker pull "${BLOCK_IMAGE}@${BLOCK_DIGEST}"', text) self.assertIn('gh release create "$GITHUB_REF_NAME"', text) self.assertIn('--latest=false', text) - self.assertIn('vars.BLOCK_RUNNER_LABEL', text) - self.assertIn("|| 'ubuntu-latest'", text) - self.assertIn('github.event.pull_request.head.repo.full_name == github.repository', text) + self.assertIn("runs-on: ubuntu-latest", text) + self.assertNotIn("BLOCK_RUNNER_LABEL", text) self.assertIn('sw-block-${version}-linux-amd64.tar.gz', text) self.assertNotIn("go build", text) for name in ("sw-block", "blockcsi"): diff --git a/.github/workflows/block-release.yml b/.github/workflows/block-release.yml index 0b34c35554..f463df3d38 100644 --- a/.github/workflows/block-release.yml +++ b/.github/workflows/block-release.yml @@ -19,7 +19,7 @@ jobs: publish: # Publish only from a version tag; a manual run from a branch must not move :alpha. if: startsWith(github.ref, 'refs/tags/seaweed-block/v') - runs-on: ${{ (github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || github.event.pull_request.head.repo.full_name == github.repository) && vars.BLOCK_RUNNER_LABEL || 'ubuntu-latest' }} + runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4