From bdb8d260cc20455ce66d4087b9aca1e53fe2154f Mon Sep 17 00:00:00 2001 From: Daniel Maricic Date: Thu, 25 Jun 2026 00:20:15 +0200 Subject: [PATCH] do --- .github/workflows/release.yml | 36 +++++++++++++++++++++++++-- .github/workflows/update-homebrew.yml | 23 ----------------- version.ts | 2 +- 3 files changed, 35 insertions(+), 26 deletions(-) delete mode 100644 .github/workflows/update-homebrew.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 06e821d..bba793a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -55,9 +55,41 @@ jobs: tag="v${{ steps.semantic.outputs.new_release_version }}" gh release upload "$tag" ocv-*.tar.gz - - name: Trigger Homebrew tap update + - name: Update Homebrew formula if: steps.semantic.outputs.new_release_published == 'true' env: GH_TOKEN: ${{ secrets.GH_PAT }} run: | - gh workflow run update-homebrew.yml --ref main -f tag=v${{ steps.semantic.outputs.new_release_version }} + TAG="v${{ steps.semantic.outputs.new_release_version }}" + VERSION="${{ steps.semantic.outputs.new_release_version }}" + + git clone https://x-access-token:${GH_TOKEN}@github.com/woss/homebrew-tap.git /tmp/homebrew-tap + cd /tmp/homebrew-tap + + # Update version line + sed -i 's/version "[0-9.]*"/version "'"${VERSION}"'"/' Formula/ocv.rb + + # Update all URL tags (vX.Y.Z → vNEW in download paths) + sed -i "s|/releases/download/v[0-9.]*/|/releases/download/${TAG}/|" Formula/ocv.rb + + # For each platform asset, compute SHA and replace + for asset in \ + ocv-aarch64-macos.tar.gz ocv-x86_64-macos.tar.gz \ + ocv-aarch64-linux.tar.gz ocv-x86_64-linux.tar.gz + do + gh release download "$TAG" \ + --repo woss/opencode-visualizer \ + --pattern "$asset" \ + --dir /tmp + new_sha=$(sha256sum "/tmp/$asset" | cut -d' ' -f1) + # Find old sha by looking at sha256 line after the URL for this asset + old_sha=$(grep -A1 "url.*${asset}" Formula/ocv.rb | \ + tail -1 | sed 's/.*sha256 "\(.*\)".*/\1/') + sed -i "s/sha256 \"${old_sha}\"/sha256 \"${new_sha}\"/" Formula/ocv.rb + done + + git config user.name "Daniel Maricic" + git config user.email "woss@users.noreply.github.com" + git add Formula/ocv.rb + git commit -m "ocv ${VERSION}" + git push diff --git a/.github/workflows/update-homebrew.yml b/.github/workflows/update-homebrew.yml deleted file mode 100644 index 774e540..0000000 --- a/.github/workflows/update-homebrew.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Update Homebrew tap - -on: - workflow_dispatch: - inputs: - tag: - description: "Git tag to bump to (e.g. v1.3.5)" - required: true - type: string -jobs: - bump: - runs-on: ubuntu-latest - steps: - - name: Set up Homebrew - uses: homebrew/actions/setup-homebrew@main - - name: Trust woss/tap - run: brew trust woss/tap - - uses: dawidd6/action-homebrew-bump-formula@v4 - with: - token: ${{ secrets.GH_PAT }} - tap: woss/homebrew-tap - formula: ocv - tag: ${{ inputs.tag }} diff --git a/version.ts b/version.ts index aa8d89d..b0f15b6 100644 --- a/version.ts +++ b/version.ts @@ -1 +1 @@ -export const VERSION = '1.3.6'; +export const VERSION = "1.3.6";