Skip to content

Commit

Permalink
Fix brew formula to use tarball and set version
Browse files Browse the repository at this point in the history
  • Loading branch information
ammario committed Sep 18, 2024
1 parent 2551f9d commit 233c2f3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ SHELL := /bin/bash
build:
set -e
mkdir -p bin
VERSION=$$(git describe --tags --always --dirty || echo "dev")
if [ -z "$$VERSION" ]; then \
VERSION=$$(git describe --tags --always --dirty || echo "dev"); \
fi
echo "Building version $${VERSION}"
go build -ldflags "-X main.Version=$${VERSION}" -o bin/aicommit ./cmd/aicommit
10 changes: 6 additions & 4 deletions brew/aicommit.rb
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
class Aicommit < Formula
desc "AI-powered commit message generator"
homepage "https://github.com/coder/aicommit"
url "https://github.com/coder/aicommit.git", revision: "HEAD"
version "0.0.0" # This will be overridden by the git describe in the Makefile
version "0.6.2"
url "https://github.com/coder/aicommit/archive/refs/tags/v#{version}.tar.gz"
sha256 "04a980875e97aebc0f7bbeaa183aa5542b18c6e009505babbd494fe0fe62b18e"
license "CC0-1.0"

depends_on "go" => "1.21"
depends_on "make" => :build

def install
system "git", "pull"
system "make", "build"
version = "v#{version}"
ENV["VERSION"] = version
system "make", "build", "VERSION=#{version}"
bin.install "bin/aicommit"
end

Expand Down

0 comments on commit 233c2f3

Please sign in to comment.