From 4eb4b2c8e3f3fdd27e316e0d24ce4794e86a1b31 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 8 Jun 2026 14:09:22 +0000 Subject: [PATCH 1/3] Initial plan From 0324606473aa4627e424ad63a7c71072abc2fe2b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 8 Jun 2026 14:12:47 +0000 Subject: [PATCH 2/3] Fix package-and-publish: mirror before publish, handle empty artifact repo --- .../build-and-publish-firmware-artifacts.yml | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-and-publish-firmware-artifacts.yml b/.github/workflows/build-and-publish-firmware-artifacts.yml index b84dcd651b..29c4299360 100644 --- a/.github/workflows/build-and-publish-firmware-artifacts.yml +++ b/.github/workflows/build-and-publish-firmware-artifacts.yml @@ -472,20 +472,14 @@ jobs: print(f'Release tag: {release_tag}') PY - - name: Publish Release To Artifact Repository - if: steps.successful_builds.outputs.has_artifacts == 'true' - shell: bash - run: | - gh release create "${{ steps.release_tag.outputs.release_tag }}" packages/*.zip \ - --repo "$ARTIFACT_REPO" \ - --title "${{ steps.release_tag.outputs.release_tag }}" \ - --notes "Automated firmware artifact bundle for ${{ github.repository }}@${{ github.sha }}" - - name: Mirror Zip Packages Into Artifact Repository if: steps.successful_builds.outputs.has_artifacts == 'true' shell: bash run: | - gh repo clone "$ARTIFACT_REPO" artifact-repo -- --depth 1 + # --depth 1 fails on an empty repository; fall back to a full clone in that case + if ! gh repo clone "$ARTIFACT_REPO" artifact-repo -- --depth 1 2>/dev/null; then + gh repo clone "$ARTIFACT_REPO" artifact-repo + fi release_dir="artifact-repo/${{ steps.release_tag.outputs.release_tag }}" mkdir -p "$release_dir" @@ -503,6 +497,15 @@ jobs: git push origin HEAD:main fi + - name: Publish Release To Artifact Repository + if: steps.successful_builds.outputs.has_artifacts == 'true' + shell: bash + run: | + gh release create "${{ steps.release_tag.outputs.release_tag }}" packages/*.zip \ + --repo "$ARTIFACT_REPO" \ + --title "${{ steps.release_tag.outputs.release_tag }}" \ + --notes "Automated firmware artifact bundle for ${{ github.repository }}@${{ github.sha }}" + - name: Upload Workflow Packages if: steps.successful_builds.outputs.has_artifacts == 'true' uses: actions/upload-artifact@v7 From 328140a5a896de2ac8dd2f09d9a7e74ca852adee Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 8 Jun 2026 14:16:31 +0000 Subject: [PATCH 3/3] Revert "Fix package-and-publish: mirror before publish, handle empty artifact repo" This reverts commit 0324606473aa4627e424ad63a7c71072abc2fe2b. --- .../build-and-publish-firmware-artifacts.yml | 23 ++++++++----------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build-and-publish-firmware-artifacts.yml b/.github/workflows/build-and-publish-firmware-artifacts.yml index 29c4299360..b84dcd651b 100644 --- a/.github/workflows/build-and-publish-firmware-artifacts.yml +++ b/.github/workflows/build-and-publish-firmware-artifacts.yml @@ -472,14 +472,20 @@ jobs: print(f'Release tag: {release_tag}') PY + - name: Publish Release To Artifact Repository + if: steps.successful_builds.outputs.has_artifacts == 'true' + shell: bash + run: | + gh release create "${{ steps.release_tag.outputs.release_tag }}" packages/*.zip \ + --repo "$ARTIFACT_REPO" \ + --title "${{ steps.release_tag.outputs.release_tag }}" \ + --notes "Automated firmware artifact bundle for ${{ github.repository }}@${{ github.sha }}" + - name: Mirror Zip Packages Into Artifact Repository if: steps.successful_builds.outputs.has_artifacts == 'true' shell: bash run: | - # --depth 1 fails on an empty repository; fall back to a full clone in that case - if ! gh repo clone "$ARTIFACT_REPO" artifact-repo -- --depth 1 2>/dev/null; then - gh repo clone "$ARTIFACT_REPO" artifact-repo - fi + gh repo clone "$ARTIFACT_REPO" artifact-repo -- --depth 1 release_dir="artifact-repo/${{ steps.release_tag.outputs.release_tag }}" mkdir -p "$release_dir" @@ -497,15 +503,6 @@ jobs: git push origin HEAD:main fi - - name: Publish Release To Artifact Repository - if: steps.successful_builds.outputs.has_artifacts == 'true' - shell: bash - run: | - gh release create "${{ steps.release_tag.outputs.release_tag }}" packages/*.zip \ - --repo "$ARTIFACT_REPO" \ - --title "${{ steps.release_tag.outputs.release_tag }}" \ - --notes "Automated firmware artifact bundle for ${{ github.repository }}@${{ github.sha }}" - - name: Upload Workflow Packages if: steps.successful_builds.outputs.has_artifacts == 'true' uses: actions/upload-artifact@v7