Skip to content

Commit

Permalink
feat: Add ARM support to Homebrew formula
Browse files Browse the repository at this point in the history
This commit updates the Homebrew formula to support both x86_64 and ARM architectures. It also includes the necessary changes to calculate SHA256 checksums for both architectures and update the formula accordingly.
  • Loading branch information
suenot committed Feb 1, 2025
1 parent 63fc040 commit c67a8f0
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 12 deletions.
40 changes: 32 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -291,37 +291,61 @@ jobs:
with:
pattern: binaries-macos-*
path: dist/
merge-multiple: true

- name: Calculate SHA256
id: sha-calc
run: |
SHA=$(sha256sum dist/aicommit-macos-x86_64 | awk '{ print $1 }')
echo "sha256=$SHA" >> $GITHUB_OUTPUT
echo "sha256_x86=$(sha256sum dist/aicommit-macos-x86_64 | awk '{ print $1 }')" >> $GITHUB_OUTPUT
echo "sha256_arm=$(sha256sum dist/aicommit-macos-aarch64 | awk '{ print $1 }')" >> $GITHUB_OUTPUT
- name: Update formula
env:
VERSION: ${{ github.ref_name }}
SHA256: ${{ steps.sha-calc.outputs.sha256 }}
SHA256_X86: ${{ steps.sha-calc.outputs.sha256_x86 }}
SHA256_ARM: ${{ steps.sha-calc.outputs.sha256_arm }}
run: |
cat > homebrew-tap/Formula/aicommit.rb <<EOL
class Aicommit < Formula
desc "AI-powered commit message generator"
homepage "https://github.com/suenot/aicommit"
url "https://github.com/suenot/aicommit/releases/download/${VERSION}/aicommit-macos-x86_64"
sha256 "${SHA256}"
version "${VERSION}"
license "MIT"
def install
bin.install "aicommit-macos-x86_64" => "aicommit"
on_macos do
on_arm do
url "https://github.com/suenot/aicommit/releases/download/${VERSION}/aicommit-macos-aarch64"
sha256 "${SHA256_ARM}"
def install
bin.install "aicommit-macos-aarch64" => "aicommit"
end
end
on_intel do
url "https://github.com/suenot/aicommit/releases/download/${VERSION}/aicommit-macos-x86_64"
sha256 "${SHA256_X86}"
def install
bin.install "aicommit-macos-x86_64" => "aicommit"
end
end
end
end
EOL
- name: Debug formula
run: |
echo "Generated formula:"
cat homebrew-tap/Formula/aicommit.rb
echo "Files in dist:"
ls -la dist/
- name: Commit and push
run: |
cd homebrew-tap
git config user.name "GitHub Actions"
git config user.email "[email protected]"
git add Formula/aicommit.rb
git commit -m "Update aicommit to ${{ github.ref_name }}"
git commit -m "Update aicommit to ${{ github.ref_name }} with ARM support"
git push
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "aicommit"
version = "0.1.105"
version = "0.1.106"
edition = "2021"
authors = ["Eugen Soloviov <[email protected]>"]
description = "A CLI tool that generates concise and descriptive git commit messages using LLMs"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@
"postinstall": "chmod +x index.js",
"start": "node index.js"
},
"version": "0.1.105"
"version": "0.1.106"
}
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.105
0.1.106

0 comments on commit c67a8f0

Please sign in to comment.