




















@@ -32,7 +32,7 @@ env:
3232CLAWHUB_REGISTRY: "https://clawhub.ai"
3333CLAWHUB_REPOSITORY: "openclaw/clawhub"
3434# Pinned to a reviewed ClawHub commit so release behavior stays reproducible.
35-CLAWHUB_REF: "199e6a0cdf32471702e0503e9899e8d24f06a527"
35+CLAWHUB_REF: "facf20ceb6cc459e2872d941e71335a784bbc55c"
36363737jobs:
3838preview_plugins_clawhub:
@@ -50,7 +50,7 @@ jobs:
5050uses: actions/checkout@v6
5151with:
5252persist-credentials: false
53-ref: ${{ github.event_name == 'workflow_dispatch' && inputs.ref || github.sha }}
53+ref: ${{ github.ref }}
5454fetch-depth: 0
55555656 - name: Setup Node environment
@@ -62,14 +62,29 @@ jobs:
62626363 - name: Resolve checked-out ref
6464id: ref
65-run: echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
66-67- - name: Validate ref is on main or a release branch
65+env:
66+TARGET_REF: ${{ github.event_name == 'workflow_dispatch' && inputs.ref || '' }}
6867run: |
6968 set -euo pipefail
7069 git fetch --no-tags origin \
7170 +refs/heads/main:refs/remotes/origin/main \
7271 '+refs/heads/release/*:refs/remotes/origin/release/*'
72+ if [[ -n "${TARGET_REF}" ]]; then
73+ if git rev-parse --verify --quiet "${TARGET_REF}^{commit}" >/dev/null; then
74+ target_sha="$(git rev-parse "${TARGET_REF}^{commit}")"
75+ elif git rev-parse --verify --quiet "origin/${TARGET_REF}^{commit}" >/dev/null; then
76+ target_sha="$(git rev-parse "origin/${TARGET_REF}^{commit}")"
77+ else
78+ echo "Unable to resolve requested publish ref: ${TARGET_REF}" >&2
79+ exit 1
80+ fi
81+ git checkout --detach "${target_sha}"
82+ fi
83+ echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
84+85+ - name: Validate ref is on main or a release branch
86+run: |
87+ set -euo pipefail
7388 if git merge-base --is-ancestor HEAD origin/main; then
7489 exit 0
7590 fi
@@ -153,6 +168,12 @@ jobs:
153168 echo "::error::One or more selected plugin versions already exist on ClawHub. Bump the version before running a real publish."
154169 exit 1
155170171+ - name: Verify OpenClaw ClawHub package ownership
172+if: steps.plan.outputs.has_candidates == 'true'
173+env:
174+CLAWHUB_REGISTRY: ${{ env.CLAWHUB_REGISTRY }}
175+run: node --import tsx scripts/plugin-clawhub-owner-preflight.ts .local/plugin-clawhub-release-plan.json
176+156177preview_plugin_pack:
157178needs: preview_plugins_clawhub
158179if: needs.preview_plugins_clawhub.outputs.has_candidates == 'true'
@@ -161,16 +182,26 @@ jobs:
161182contents: read
162183strategy:
163184fail-fast: false
164-max-parallel: 1
185+max-parallel: 6
165186matrix:
166187plugin: ${{ fromJson(needs.preview_plugins_clawhub.outputs.matrix) }}
167188steps:
168189 - name: Checkout
169190uses: actions/checkout@v6
170191with:
171192persist-credentials: false
172-ref: ${{ needs.preview_plugins_clawhub.outputs.ref_revision }}
173-fetch-depth: 1
193+ref: ${{ github.ref }}
194+fetch-depth: 0
195+196+ - name: Checkout target revision
197+env:
198+TARGET_SHA: ${{ needs.preview_plugins_clawhub.outputs.ref_revision }}
199+run: |
200+ set -euo pipefail
201+ git fetch --no-tags origin \
202+ +refs/heads/main:refs/remotes/origin/main \
203+ '+refs/heads/release/*:refs/remotes/origin/release/*'
204+ git checkout --detach "${TARGET_SHA}"
174205175206 - name: Setup Node environment
176207uses: ./.github/actions/setup-node-env
@@ -185,9 +216,15 @@ jobs:
185216with:
186217persist-credentials: false
187218repository: ${{ env.CLAWHUB_REPOSITORY }}
188-ref: ${{ env.CLAWHUB_REF }}
219+ref: main
189220path: clawhub-source
190-fetch-depth: 1
221+fetch-depth: 0
222+223+ - name: Checkout pinned ClawHub CLI revision
224+working-directory: clawhub-source
225+env:
226+CLAWHUB_REF: ${{ env.CLAWHUB_REF }}
227+run: git checkout --detach "${CLAWHUB_REF}"
191228192229 - name: Install ClawHub CLI dependencies
193230working-directory: clawhub-source
@@ -203,6 +240,9 @@ jobs:
203240 chmod +x "$RUNNER_TEMP/clawhub"
204241 echo "$RUNNER_TEMP" >> "$GITHUB_PATH"
205242243+ - name: Verify package-local runtime build
244+run: pnpm release:plugins:npm:runtime:check --package "${{ matrix.plugin.packageDir }}"
245+206246 - name: Preview publish command
207247env:
208248CLAWHUB_REGISTRY: ${{ env.CLAWHUB_REGISTRY }}
@@ -223,15 +263,26 @@ jobs:
223263id-token: write
224264strategy:
225265fail-fast: false
266+max-parallel: 6
226267matrix:
227268plugin: ${{ fromJson(needs.preview_plugins_clawhub.outputs.matrix) }}
228269steps:
229270 - name: Checkout
230271uses: actions/checkout@v6
231272with:
232273persist-credentials: false
233-ref: ${{ needs.preview_plugins_clawhub.outputs.ref_revision }}
234-fetch-depth: 1
274+ref: ${{ github.ref }}
275+fetch-depth: 0
276+277+ - name: Checkout target revision
278+env:
279+TARGET_SHA: ${{ needs.preview_plugins_clawhub.outputs.ref_revision }}
280+run: |
281+ set -euo pipefail
282+ git fetch --no-tags origin \
283+ +refs/heads/main:refs/remotes/origin/main \
284+ '+refs/heads/release/*:refs/remotes/origin/release/*'
285+ git checkout --detach "${TARGET_SHA}"
235286236287 - name: Setup Node environment
237288uses: ./.github/actions/setup-node-env
@@ -246,9 +297,15 @@ jobs:
246297with:
247298persist-credentials: false
248299repository: ${{ env.CLAWHUB_REPOSITORY }}
249-ref: ${{ env.CLAWHUB_REF }}
300+ref: main
250301path: clawhub-source
251-fetch-depth: 1
302+fetch-depth: 0
303+304+ - name: Checkout pinned ClawHub CLI revision
305+working-directory: clawhub-source
306+env:
307+CLAWHUB_REF: ${{ env.CLAWHUB_REF }}
308+run: git checkout --detach "${CLAWHUB_REF}"
252309253310 - name: Install ClawHub CLI dependencies
254311working-directory: clawhub-source
@@ -304,7 +361,19 @@ jobs:
304361 encoded_name="$(node -e 'console.log(encodeURIComponent(process.env.PACKAGE_NAME ?? ""))')"
305362 encoded_version="$(node -e 'console.log(encodeURIComponent(process.env.PACKAGE_VERSION ?? ""))')"
306363 url="${CLAWHUB_REGISTRY%/}/api/v1/packages/${encoded_name}/versions/${encoded_version}"
307- status="$(curl --silent --show-error --output /dev/null --write-out '%{http_code}' "${url}")"
364+ status=""
365+ for attempt in $(seq 1 8); do
366+ status="$(curl --silent --show-error --output /dev/null --write-out '%{http_code}' "${url}")"
367+ if [[ "${status}" == "404" || "${status}" =~ ^2 ]]; then
368+ break
369+ fi
370+ if [[ "${status}" == "429" || "${status}" =~ ^5 ]]; then
371+ echo "ClawHub availability check returned ${status} for ${PACKAGE_NAME}@${PACKAGE_VERSION}; retrying (${attempt}/8)."
372+ sleep 60
373+ continue
374+ fi
375+ break
376+ done
308377 if [[ "${status}" =~ ^2 ]]; then
309378 echo "${PACKAGE_NAME}@${PACKAGE_VERSION} is already published on ClawHub."
310379 exit 1
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。