diff --git a/.github/workflows/deploy-auto.yml b/.github/workflows/deploy-auto.yml index b1fa323113..0fab47281d 100644 --- a/.github/workflows/deploy-auto.yml +++ b/.github/workflows/deploy-auto.yml @@ -5,6 +5,12 @@ on: tags: - 'v*' # 当推送带有 v 前缀的标签时触发 +# Unlike deploy-manual.yml, no job here asks for `fetch-tags`. This workflow is triggered *by* the +# tag, so the tag is the ref being checked out and is already there — `check-release.js` finds it. +# Asking for it on top makes checkout fetch the commit and the tag into the same `refs/tags/*`, +# which git refuses: "Cannot fetch both and refs/tags/vX to refs/tags/vX". That failure took +# down every tag-triggered release from v0.0.5 onwards. + env: NODE_VERSION: '23.11.1' BUILD_MODE: release @@ -16,8 +22,6 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 - with: - fetch-tags: true - name: Setup Node.js uses: actions/setup-node@v4 @@ -66,8 +70,6 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 - with: - fetch-tags: true - name: Setup Node.js uses: actions/setup-node@v4 @@ -103,8 +105,6 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 - with: - fetch-tags: true - name: Setup Node.js uses: actions/setup-node@v4 @@ -127,8 +127,6 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 - with: - fetch-tags: true - name: Prepare notification run: | @@ -157,8 +155,6 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 - with: - fetch-tags: true - name: Prepare notification run: | diff --git a/scripts/cli b/scripts/cli index aa7ef8b0f9..f26dfcf211 100755 --- a/scripts/cli +++ b/scripts/cli @@ -63,6 +63,15 @@ cmd_build_json2type () { cmd_release () { [[ `git branch --show-current` != "main" ]] || fail 'please do not release from `main` branch' + + # `lerna version` starts with `git remote update`, which fetches every remote and recurses into + # their submodules. Branches on the upstream fork reference `rum-events-format` commits its own + # remote does not serve, so that fetch fails and takes the release down before anything is + # tagged. Nothing here reads upstream, so keep it out of the update. Idempotent, and a no-op for + # anyone without that remote. + if git remote get-url upstream > /dev/null 2>&1; then + git config remote.upstream.skipDefaultUpdate true + fi # We should publish all packages regardless of if there are changes in each. # --force-publish will skip the `lerna changed` check for changed packages # https://github.com/lerna/lerna/tree/main/libs/commands/version#--force-publish