From dc7a200b93e81b5653c4692e2a735dbbac8293a5 Mon Sep 17 00:00:00 2001 From: Kevin Yue Date: Sun, 21 Jun 2026 22:28:49 +0800 Subject: [PATCH] ci: avoid Docker Hub auth pulls in release builds --- .github/workflows/build.yaml | 11 +++++++---- .github/workflows/release.yaml | 2 -- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index fbe50d4..1c1fa21 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -130,6 +130,7 @@ jobs: if-no-files-found: error build-gp: + if: ${{ !startsWith(github.ref, 'refs/tags/') }} needs: - tarball strategy: @@ -154,8 +155,6 @@ jobs: with: name: artifact-source path: build-gp-${{ matrix.package }} - - name: Docker Login - run: echo ${{ secrets.DOCKER_HUB_TOKEN }} | docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} --password-stdin - name: Build ${{ matrix.package }} package in Docker # LIBXML2_STATIC is needed to avoid the dynamic linking issue on different distros run: | @@ -183,6 +182,7 @@ jobs: build-gp-${{ matrix.package }}/artifacts/* build-docker-image: + if: ${{ !startsWith(github.ref, 'refs/tags/') }} strategy: fail-fast: false matrix: @@ -243,6 +243,7 @@ jobs: build-gpgui: strategy: fail-fast: false + max-parallel: 1 matrix: os: - runner: ubuntu-latest @@ -283,8 +284,6 @@ jobs: run: | cd gpgui-source tar -czf gpgui.tar.gz gpgui gp - - name: Docker Login - run: echo ${{ secrets.DOCKER_HUB_TOKEN }} | docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} --password-stdin - name: Build gpgui in Docker run: | docker run --rm \ @@ -601,6 +600,7 @@ jobs: env: NEEDS_JSON: ${{ toJson(needs) }} BSD_MATRIX_ENABLED: ${{ needs.setup-bsd-matrix.outputs.enabled }} + IS_TAG: ${{ startsWith(github.ref, 'refs/tags/') }} run: | python3 - <<'PY' import json @@ -609,12 +609,15 @@ jobs: needs = json.loads(os.environ["NEEDS_JSON"]) bsd_matrix_enabled = os.environ["BSD_MATRIX_ENABLED"] == "true" + is_tag = os.environ["IS_TAG"] == "true" failed = [] for name, data in needs.items(): result = data["result"] if result in {"failure", "cancelled"}: failed.append(f"{name}: {result}") + elif name in {"build-gp", "build-docker-image"} and result == "skipped" and is_tag: + continue elif name in {"build-gpgui-frontend", "build-bsd"} and result == "skipped" and not bsd_matrix_enabled: continue elif result == "skipped": diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 3b52e0f..ea44e09 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -117,8 +117,6 @@ jobs: --pattern '*[^offline].tar.gz' \ --dir build-${{ matrix.package }} - - name: Docker Login - run: echo ${{ secrets.DOCKER_HUB_TOKEN }} | docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} --password-stdin - name: Build ${{ matrix.package }} package in Docker # LIBXML2_STATIC is needed to avoid the dynamic linking issue on different distros run: |