Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/validate-homebrew.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Validate Homebrew Installation

on:
pull_request:
types: [closed]

jobs:
validate-homebrew:
if: github.event.pull_request.merged == true && startsWith(github.event.pull_request.title, 'Update Homebrew formula')
strategy:
fail-fast: false
matrix:
include:
- os: macos-latest
name: macOS ARM64
- os: ubuntu-latest
name: Linux x64
- os: ubuntu-24.04-arm
name: Linux ARM64

name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Homebrew
uses: Homebrew/actions/setup-homebrew@master

- name: Tap and install modernize
run: |
brew tap ${{ github.repository }} https://github.com/${{ github.repository }}
brew install modernize

- name: Extract expected version from formula
id: formula
run: |
version=$(grep '^ version ' Formula/modernize.rb | sed 's/.*"\(.*\)".*/\1/')
echo "version=$version" >> "$GITHUB_OUTPUT"
echo "Expected version: $version"

- name: Verify installation
run: |
output=$(modernize --version)
echo "Version output: $output"
if echo "$output" | grep -q "${{ steps.formula.outputs.version }}"; then
echo "Version verified successfully"
else
echo "::error::Version mismatch. Expected '${{ steps.formula.outputs.version }}' in output but got: $output"
exit 1
fi
21 changes: 11 additions & 10 deletions Formula/modernize.rb
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
class Modernize < Formula
desc "AI-powered CLI for application modernization"
homepage "https://github.com/microsoft/modernize-cli"
version "0.0.226"
version "0.0.246"

if OS.mac?
if Hardware::CPU.intel?
url "https://github.com/microsoft/modernize-cli/releases/download/v0.0.226/modernize_0.0.226_darwin_x64.tar.gz"
sha256 "b18a7de04f36cb0236f122af0417110f9b2a7f7daa03ef6a130e8d837de7754e"
url "https://github.com/microsoft/modernize-cli/releases/download/v0.0.246/modernize_0.0.246_darwin_x64.tar.gz"
sha256 "4f8f46bfac505479e707211eb5b06cb20d480b1e695656245f5a613d17ff0a55"
elsif Hardware::CPU.arm?
url "https://github.com/microsoft/modernize-cli/releases/download/v0.0.226/modernize_0.0.226_darwin_arm64.tar.gz"
sha256 "786c7ae517a19c329702e977c0e871e3b503b31a87bc04f8024fabb18f6c7629"
url "https://github.com/microsoft/modernize-cli/releases/download/v0.0.246/modernize_0.0.246_darwin_arm64.tar.gz"
sha256 "8cb36ba5152948086b95478211b0ebaaa7204367b6fae7477a70fa38db83a9d0"
end
elsif OS.linux?
if Hardware::CPU.intel?
url "https://github.com/microsoft/modernize-cli/releases/download/v0.0.226/modernize_0.0.226_linux_x64.tar.gz"
sha256 "fdc582131e933f8fbe978da7601c9d2cdf40044305adc93c668ab501dee11f58"
url "https://github.com/microsoft/modernize-cli/releases/download/v0.0.246/modernize_0.0.246_linux_x64.tar.gz"
sha256 "1264ecbc0187f5e59822f939702e96850069c28c62f6bd0e13622bae403ec381"
elsif Hardware::CPU.arm?
url "https://github.com/microsoft/modernize-cli/releases/download/v0.0.226/modernize_0.0.226_linux_arm64.tar.gz"
sha256 "426b254c7808d8cdd482468b754815872993a85b4b9b2ed14871438700aa15fa"
url "https://github.com/microsoft/modernize-cli/releases/download/v0.0.246/modernize_0.0.246_linux_arm64.tar.gz"
sha256 "a11429f057eadf0d0ae909306907ac7e5dccf859e90d7763abc2d92334c198e4"
end
end

Expand All @@ -34,4 +34,5 @@ def install
assert_equal 0, $CHILD_STATUS.exitstatus
assert_match "modernize", version_output
end
end
end

Loading