From b838d4bb4254ac68eeeb4ccd02df9ebf2b12ddda Mon Sep 17 00:00:00 2001 From: whyour Date: Tue, 10 Nov 2026 02:16:01 +0800 Subject: [PATCH] fix(ci): create develop RC publish job explicitly --- .github/workflows/build-docker-image.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-docker-image.yml b/.github/workflows/build-docker-image.yml index 2216d383..f220b7ef 100644 --- a/.github/workflows/build-docker-image.yml +++ b/.github/workflows/build-docker-image.yml @@ -474,7 +474,7 @@ jobs: retention-days: 14 publish: - if: ${{ github.repository == 'whyour/qinglong' && (github.ref == 'refs/heads/master' || (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/develop' && inputs.npm_rc_version != '')) }} + if: ${{ github.repository == 'whyour/qinglong' && (github.ref == 'refs/heads/master' || (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/develop')) }} needs: [build-alpine, build-debian, verify-npm-package] runs-on: ubuntu-latest permissions: @@ -509,8 +509,8 @@ jobs: metadata=$(tar -xOf "$archive" package/package.json) name=$(jq -er '.name | select(. == "@whyour/qinglong")' <<< "$metadata") version=$(jq -er '.version | select(type == "string")' <<< "$metadata") - if [[ "${GITHUB_REF:-}" == refs/heads/develop && -n "${NPM_RC_VERSION:-}" ]]; then - if [[ ! "$NPM_RC_VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+-rc\.[0-9]+$ || "$version" != "$NPM_RC_VERSION" ]]; then + if [[ "${GITHUB_EVENT_NAME:-}" == workflow_dispatch && "${GITHUB_REF:-}" == refs/heads/develop ]]; then + if [[ ! "${NPM_RC_VERSION:-}" =~ ^[0-9]+\.[0-9]+\.[0-9]+-rc\.[0-9]+$ || "$version" != "${NPM_RC_VERSION:-}" ]]; then echo '::error::Develop npm publication requires the exact requested RC archive version.' exit 1 fi @@ -519,7 +519,7 @@ jobs: jq -e --arg version "$version" '. == $version' "$RUNNER_TEMP/npm-version.json" > /dev/null echo "::notice::$name@$version is already published; skipping npm publication for this image rebuild." elif jq -e '.error.code == "E404"' "$RUNNER_TEMP/npm-version.json" > /dev/null; then - if [[ "${GITHUB_REF:-}" == refs/heads/develop && -n "${NPM_RC_VERSION:-}" ]]; then + if [[ "${GITHUB_EVENT_NAME:-}" == workflow_dispatch && "${GITHUB_REF:-}" == refs/heads/develop ]]; then npm publish "./$archive" --ignore-scripts --access public --tag rc --registry=https://registry.npmjs.org else npm publish "./$archive" --ignore-scripts --access public --registry=https://registry.npmjs.org