Skip to content

Commit

Permalink
Now make the homebrew recipe work
Browse files Browse the repository at this point in the history
  • Loading branch information
rfay committed Nov 14, 2024
1 parent adb21b5 commit a77defe
Showing 1 changed file with 40 additions and 15 deletions.
55 changes: 40 additions & 15 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -185,21 +185,33 @@ brews:

custom_block: |
head do
url "https://github.com/ddev/ddev.git", branch: "master"
url "https://github.com/{{ .Env.REPOSITORY_OWNER }}/ddev.git", branch: "master"
resource "ddev-binary" do
arch = Hardware::CPU.arm? ? "arm64" : "amd64"
os = OS.mac? ? "macos" : "linux"
url "https://nightly.link/ddev/ddev/workflows/master-build/master/ddev-#{os}-#{arch}.zip"
sha256 "" # We'd need to figure out how to handle this for nightlies
url "https://nightly.link/{{ .Env.REPOSITORY_OWNER }}/ddev/workflows/master-build/master/ddev-head-artifacts.zip"
sha256 "" # We'll need to skip checksum verification for nightlies
end
end
install: |
if build.head?
resource("ddev-binary").stage do
system "unzip", "-o", Dir["*.zip"].first if Dir["*.zip"].any?
# First unzip the main artifact
system "unzip", "-o", "ddev-head-artifacts.zip"
# Verify checksums
system "sha256sum", "-c", "checksums.txt"
# Now get the appropriate inner zipfile based on architecture
os = OS.mac? ? "macos" : "linux"
arch = Hardware::CPU.arm? ? "arm64" : "amd64"
inner_zip = "ddev_#{os}_#{arch}.zip"
# Unzip the architecture-specific binary and completions
system "unzip", "-o", inner_zip
bin.install "ddev"
# In the future, we could get and install the completion files
bash_completion.install "ddev_bash_completion.sh" => "ddev"
zsh_completion.install "ddev_zsh_completion.sh" => "_ddev"
fish_completion.install "ddev_fish_completion.sh" => "ddev.fish"
end
else
bin.install "ddev"
Expand All @@ -208,7 +220,6 @@ brews:
fish_completion.install "ddev_fish_completion.sh" => "ddev.fish"
end
test: |
system "#{bin}/ddev --version"
Expand All @@ -226,23 +237,37 @@ brews:
skip_upload: "false"
dependencies:
- name: mkcert

custom_block: |
head do
url "https://github.com/ddev/ddev.git", branch: "master"
url "https://github.com/{{ .Env.REPOSITORY_OWNER }}/ddev.git", branch: "master"
resource "ddev-binary" do
arch = Hardware::CPU.arm? ? "arm64" : "amd64"
os = OS.mac? ? "macos" : "linux"
url "https://nightly.link/ddev/ddev/workflows/master-build/master/ddev-#{os}-#{arch}.zip"
sha256 "" # We'd need to figure out how to handle this for nightlies
url "https://nightly.link/{{ .Env.REPOSITORY_OWNER }}/ddev/workflows/master-build/master/ddev-head-artifacts.zip"
sha256 "" # We'll need to skip checksum verification for nightlies
end
end
install: |
if build.head?
resource("ddev-binary").stage do
system "unzip", "-o", Dir["*.zip"].first if Dir["*.zip"].any?
# First unzip the main artifact
system "unzip", "-o", "ddev-head-artifacts.zip"
# Verify checksums
system "sha256sum", "-c", "checksums.txt"
# Now get the appropriate inner zipfile based on architecture
os = OS.mac? ? "macos" : "linux"
arch = Hardware::CPU.arm? ? "arm64" : "amd64"
inner_zip = "ddev_#{os}_#{arch}.zip"
# Unzip the architecture-specific binary and completions
system "unzip", "-o", inner_zip
bin.install "ddev"
# In the future, we could get and install the completion files
bash_completion.install "ddev_bash_completion.sh" => "ddev"
zsh_completion.install "ddev_zsh_completion.sh" => "_ddev"
fish_completion.install "ddev_fish_completion.sh" => "ddev.fish"
end
else
bin.install "ddev"
Expand Down

0 comments on commit a77defe

Please sign in to comment.