From 00605a9ff654d80dcd68c4d0c088382deb23e8f1 Mon Sep 17 00:00:00 2001 From: Lucas Saavedra Vaz <32426024+lucasssvaz@users.noreply.github.com> Date: Mon, 27 Oct 2025 15:59:01 -0300 Subject: [PATCH] ci(hosted): Copy esp-hosted binaries to gh-pages --- .github/scripts/on-release.sh | 5 +++++ .github/workflows/release.yml | 42 +++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) diff --git a/.github/scripts/on-release.sh b/.github/scripts/on-release.sh index dec2723eabb..c4dadccc4f7 100755 --- a/.github/scripts/on-release.sh +++ b/.github/scripts/on-release.sh @@ -391,6 +391,11 @@ pushd "$OUTPUT_DIR" >/dev/null tar -cJf "$LIBS_XZ" "esp32-arduino-libs" popd >/dev/null +# Copy esp-hosted binaries + +mkdir -p "$GITHUB_WORKSPACE/hosted" +cp "$OUTPUT_DIR/esp32-arduino-libs/hosted"/*.bin "$GITHUB_WORKSPACE/hosted/" + # Upload ZIP and XZ libs to release page echo "Uploading ZIP libs to release page ..." diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index acba6c54e68..8619cc74904 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -36,3 +36,45 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.TOOLS_UPLOAD_PAT }} run: bash ./.github/scripts/on-release.sh + + - name: Upload hosted binaries + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + with: + name: hosted + if-no-files-found: ignore + path: ${{ github.workspace }}/hosted + + upload-hosted-binaries: + name: Upload hosted binaries + needs: build + runs-on: ubuntu-latest + steps: + - name: Checkout gh-pages branch + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + ref: gh-pages + + - name: Download hosted binaries + uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1 + with: + name: hosted + path: ${{ github.workspace }}/hosted-latest + + - name: Copy hosted binaries to proper directory and commit + env: + GITHUB_TOKEN: ${{ secrets.TOOLS_UPLOAD_PAT }} + run: | + # Create hosted directory if it doesn't exist + mkdir -p ${{ github.workspace }}/hosted + + # Copy hosted binaries to proper directory without overwriting existing files + cp -n ${{ github.workspace }}/hosted-latest/*.bin ${{ github.workspace }}/hosted/ + + # Commit the changes + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git add hosted/*.bin + if ! git diff --cached --quiet; then + git commit -m "Add new esp-hosted slave binaries" + git push origin HEAD:gh-pages + fi