From a387f364e6fffba88278a8a7535b753aa00b90a0 Mon Sep 17 00:00:00 2001 From: Krish Suchak Date: Tue, 27 Jan 2026 01:12:17 -0500 Subject: [PATCH 1/8] fix brew-tap --- .github/workflows/release.yml | 36 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5a543e4..69a411a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -309,7 +309,9 @@ jobs: steps: - uses: actions/checkout@v5 - - name: Generate formula from template + - name: Generate and push formula + env: + GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} run: | NAME="${{ github.event.repository.name }}" TAG="${{ needs.version.outputs.tag_name }}" @@ -328,31 +330,27 @@ jobs: # Build source lines for release (url + sha256 + head) SOURCE_LINE="url \"${TARBALL_URL}\"\n sha256 \"${SHA256}\"\n head \"https://github.com/${REPO}.git\", branch: \"master\"" - # Generate formula from template into Formula directory - mkdir -p Formula + # Clone homebrew-tap repo (preserves all existing formulas) + git clone https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository_owner }}/homebrew-tap.git tap-repo + cd tap-repo + + # Generate formula directly in repo root (no Formula subdirectory) sed -e "s|{{NAME}}|${NAME}|g" \ -e "s|{{CLASS_NAME}}|${CLASS_NAME}|g" \ -e "s|{{DESCRIPTION}}|${DESCRIPTION}|g" \ -e "s|{{HOMEPAGE}}|https://github.com/${REPO}|g" \ -e "s|{{SOURCE_LINE}}|${SOURCE_LINE}|g" \ - .github/templates/formula.rb.template > "Formula/${NAME}.rb" + ../.github/templates/formula.rb.template > "${NAME}.rb" echo "Generated formula:" - cat "Formula/${NAME}.rb" - - - name: Push to homebrew-tap - uses: cpina/github-action-push-to-another-repository@v1 - env: - API_TOKEN_GITHUB: ${{ secrets.HOMEBREW_TAP_TOKEN }} - with: - source-directory: 'Formula' - destination-github-username: '${{ github.repository_owner }}' - destination-repository-name: 'homebrew-tap' - target-directory: 'Formula' - target-branch: 'master' - user-email: 'github-actions[bot]@users.noreply.github.com' - user-name: 'github-actions[bot]' - commit-message: 'Update ${{ github.event.repository.name }} to ${{ needs.version.outputs.tag_name }}' + cat "${NAME}.rb" + + # Commit and push + git config user.email "github-actions[bot]@users.noreply.github.com" + git config user.name "github-actions[bot]" + git add "${NAME}.rb" + git commit -m "Update ${NAME} to ${TAG}" || echo "No changes to commit" + git push origin master smoke-homebrew: name: Smoke Homebrew From 56b58dc7da584d71abcec50e34667925f4767e4c Mon Sep 17 00:00:00 2001 From: Krish Suchak Date: Tue, 27 Jan 2026 01:12:29 -0500 Subject: [PATCH 2/8] #patch From f63f5f47f971de54756c7e0174526cc93d992bd7 Mon Sep 17 00:00:00 2001 From: Krish Suchak Date: Tue, 27 Jan 2026 01:24:22 -0500 Subject: [PATCH 3/8] improve token security --- .github/workflows/release.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 69a411a..7da45ca 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -330,8 +330,17 @@ jobs: # Build source lines for release (url + sha256 + head) SOURCE_LINE="url \"${TARBALL_URL}\"\n sha256 \"${SHA256}\"\n head \"https://github.com/${REPO}.git\", branch: \"master\"" + # Configure git credentials for GitHub using GITHUB_TOKEN + git config --global credential.helper store + git credential approve < Date: Tue, 27 Jan 2026 01:28:41 -0500 Subject: [PATCH 4/8] improve git commit and push --- .github/workflows/release.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7da45ca..96d74bf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -358,8 +358,19 @@ jobs: git config user.email "github-actions[bot]@users.noreply.github.com" git config user.name "github-actions[bot]" git add "${NAME}.rb" - git commit -m "Update ${NAME} to ${TAG}" || echo "No changes to commit" - git push origin master + + if git diff --cached --quiet; then + echo "No changes to commit for ${NAME}.rb" + else + git commit -m "Update ${NAME} to ${TAG}" + fi + + # Only push if there are new commits compared to origin/master + if git log origin/master..HEAD --oneline | grep -q '.'; then + git push origin master + else + echo "No new commits to push" + fi smoke-homebrew: name: Smoke Homebrew From bbf29d6e5252b0b5f9a62ffdf8129ea78cfe85e8 Mon Sep 17 00:00:00 2001 From: Krish Suchak Date: Tue, 27 Jan 2026 01:45:03 -0500 Subject: [PATCH 5/8] add pypi polling --- .github/workflows/pr.yml | 18 +++++++++++++++++- .github/workflows/release.yml | 18 +++++++++++++++++- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index e5baedd..514beff 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -196,7 +196,23 @@ jobs: python-version: '3.13' - name: Wait for TestPyPI indexing - run: sleep 180 + run: | + NAME="${{ github.event.repository.name }}" + VERSION="${{ needs.version.outputs.pypi_version }}" + MAX_ATTEMPTS=40 + SLEEP_SECONDS=15 + + echo "Waiting for ${NAME}==${VERSION} to be available on TestPyPI..." + for i in $(seq 1 $MAX_ATTEMPTS); do + if curl -sf "https://test.pypi.org/pypi/${NAME}/${VERSION}/json" > /dev/null 2>&1; then + echo "Package available after $((i * SLEEP_SECONDS)) seconds" + exit 0 + fi + echo "Attempt $i/$MAX_ATTEMPTS: Package not yet available, waiting ${SLEEP_SECONDS}s..." + sleep $SLEEP_SECONDS + done + echo "Timed out waiting for package after $((MAX_ATTEMPTS * SLEEP_SECONDS)) seconds" + exit 1 - name: Install from TestPyPI run: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 96d74bf..ceeb691 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -253,7 +253,23 @@ jobs: python-version: '3.13' - name: Wait for PyPI indexing - run: sleep 180 + run: | + NAME="${{ github.event.repository.name }}" + VERSION="${{ needs.version.outputs.pypi_version }}" + MAX_ATTEMPTS=40 + SLEEP_SECONDS=15 + + echo "Waiting for ${NAME}==${VERSION} to be available on PyPI..." + for i in $(seq 1 $MAX_ATTEMPTS); do + if curl -sf "https://pypi.org/pypi/${NAME}/${VERSION}/json" > /dev/null 2>&1; then + echo "Package available after $((i * SLEEP_SECONDS)) seconds" + exit 0 + fi + echo "Attempt $i/$MAX_ATTEMPTS: Package not yet available, waiting ${SLEEP_SECONDS}s..." + sleep $SLEEP_SECONDS + done + echo "Timed out waiting for package after $((MAX_ATTEMPTS * SLEEP_SECONDS)) seconds" + exit 1 - name: Install from PyPI run: pip install ${{ github.event.repository.name }}==${{ needs.version.outputs.pypi_version }} From 70c88f65a1f2ce8d64e5c0a41545771934abb9f3 Mon Sep 17 00:00:00 2001 From: Krish Suchak Date: Tue, 27 Jan 2026 01:51:44 -0500 Subject: [PATCH 6/8] try again --- .github/workflows/pr.yml | 8 ++++---- .github/workflows/release.yml | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 514beff..08d6425 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -191,10 +191,6 @@ jobs: steps: - uses: actions/checkout@v5 - - uses: actions/setup-python@v6 - with: - python-version: '3.13' - - name: Wait for TestPyPI indexing run: | NAME="${{ github.event.repository.name }}" @@ -214,6 +210,10 @@ jobs: echo "Timed out waiting for package after $((MAX_ATTEMPTS * SLEEP_SECONDS)) seconds" exit 1 + - uses: actions/setup-python@v6 + with: + python-version: '3.13' + - name: Install from TestPyPI run: | pip install --index-url https://test.pypi.org/simple/ \ diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ceeb691..d4b873e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -248,10 +248,6 @@ jobs: steps: - uses: actions/checkout@v5 - - uses: actions/setup-python@v6 - with: - python-version: '3.13' - - name: Wait for PyPI indexing run: | NAME="${{ github.event.repository.name }}" @@ -271,6 +267,10 @@ jobs: echo "Timed out waiting for package after $((MAX_ATTEMPTS * SLEEP_SECONDS)) seconds" exit 1 + - uses: actions/setup-python@v6 + with: + python-version: '3.13' + - name: Install from PyPI run: pip install ${{ github.event.repository.name }}==${{ needs.version.outputs.pypi_version }} From b9f2429690377c932c06be842a4de4b7de4aecfd Mon Sep 17 00:00:00 2001 From: Krish Suchak Date: Tue, 27 Jan 2026 01:57:20 -0500 Subject: [PATCH 7/8] remove polling --- .github/workflows/pr.yml | 19 ------------------- .github/workflows/release.yml | 19 ------------------- 2 files changed, 38 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 08d6425..adb655b 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -191,25 +191,6 @@ jobs: steps: - uses: actions/checkout@v5 - - name: Wait for TestPyPI indexing - run: | - NAME="${{ github.event.repository.name }}" - VERSION="${{ needs.version.outputs.pypi_version }}" - MAX_ATTEMPTS=40 - SLEEP_SECONDS=15 - - echo "Waiting for ${NAME}==${VERSION} to be available on TestPyPI..." - for i in $(seq 1 $MAX_ATTEMPTS); do - if curl -sf "https://test.pypi.org/pypi/${NAME}/${VERSION}/json" > /dev/null 2>&1; then - echo "Package available after $((i * SLEEP_SECONDS)) seconds" - exit 0 - fi - echo "Attempt $i/$MAX_ATTEMPTS: Package not yet available, waiting ${SLEEP_SECONDS}s..." - sleep $SLEEP_SECONDS - done - echo "Timed out waiting for package after $((MAX_ATTEMPTS * SLEEP_SECONDS)) seconds" - exit 1 - - uses: actions/setup-python@v6 with: python-version: '3.13' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d4b873e..6930fef 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -248,25 +248,6 @@ jobs: steps: - uses: actions/checkout@v5 - - name: Wait for PyPI indexing - run: | - NAME="${{ github.event.repository.name }}" - VERSION="${{ needs.version.outputs.pypi_version }}" - MAX_ATTEMPTS=40 - SLEEP_SECONDS=15 - - echo "Waiting for ${NAME}==${VERSION} to be available on PyPI..." - for i in $(seq 1 $MAX_ATTEMPTS); do - if curl -sf "https://pypi.org/pypi/${NAME}/${VERSION}/json" > /dev/null 2>&1; then - echo "Package available after $((i * SLEEP_SECONDS)) seconds" - exit 0 - fi - echo "Attempt $i/$MAX_ATTEMPTS: Package not yet available, waiting ${SLEEP_SECONDS}s..." - sleep $SLEEP_SECONDS - done - echo "Timed out waiting for package after $((MAX_ATTEMPTS * SLEEP_SECONDS)) seconds" - exit 1 - - uses: actions/setup-python@v6 with: python-version: '3.13' From a6104a99979cddaecc3452d85e219de162a900f1 Mon Sep 17 00:00:00 2001 From: Krish Suchak Date: Tue, 27 Jan 2026 02:00:25 -0500 Subject: [PATCH 8/8] Revert "remove polling" This reverts commit b9f2429690377c932c06be842a4de4b7de4aecfd. --- .github/workflows/pr.yml | 19 +++++++++++++++++++ .github/workflows/release.yml | 19 +++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index adb655b..08d6425 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -191,6 +191,25 @@ jobs: steps: - uses: actions/checkout@v5 + - name: Wait for TestPyPI indexing + run: | + NAME="${{ github.event.repository.name }}" + VERSION="${{ needs.version.outputs.pypi_version }}" + MAX_ATTEMPTS=40 + SLEEP_SECONDS=15 + + echo "Waiting for ${NAME}==${VERSION} to be available on TestPyPI..." + for i in $(seq 1 $MAX_ATTEMPTS); do + if curl -sf "https://test.pypi.org/pypi/${NAME}/${VERSION}/json" > /dev/null 2>&1; then + echo "Package available after $((i * SLEEP_SECONDS)) seconds" + exit 0 + fi + echo "Attempt $i/$MAX_ATTEMPTS: Package not yet available, waiting ${SLEEP_SECONDS}s..." + sleep $SLEEP_SECONDS + done + echo "Timed out waiting for package after $((MAX_ATTEMPTS * SLEEP_SECONDS)) seconds" + exit 1 + - uses: actions/setup-python@v6 with: python-version: '3.13' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6930fef..d4b873e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -248,6 +248,25 @@ jobs: steps: - uses: actions/checkout@v5 + - name: Wait for PyPI indexing + run: | + NAME="${{ github.event.repository.name }}" + VERSION="${{ needs.version.outputs.pypi_version }}" + MAX_ATTEMPTS=40 + SLEEP_SECONDS=15 + + echo "Waiting for ${NAME}==${VERSION} to be available on PyPI..." + for i in $(seq 1 $MAX_ATTEMPTS); do + if curl -sf "https://pypi.org/pypi/${NAME}/${VERSION}/json" > /dev/null 2>&1; then + echo "Package available after $((i * SLEEP_SECONDS)) seconds" + exit 0 + fi + echo "Attempt $i/$MAX_ATTEMPTS: Package not yet available, waiting ${SLEEP_SECONDS}s..." + sleep $SLEEP_SECONDS + done + echo "Timed out waiting for package after $((MAX_ATTEMPTS * SLEEP_SECONDS)) seconds" + exit 1 + - uses: actions/setup-python@v6 with: python-version: '3.13'