Skip to content

Commit

Permalink
Revert the monster-binary technique for homebrew
Browse files Browse the repository at this point in the history
  • Loading branch information
rfay committed Nov 15, 2024
1 parent 814deda commit 8d7384a
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 61 deletions.
74 changes: 46 additions & 28 deletions .github/workflows/master-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -279,38 +279,56 @@ jobs:
env:
CGO_ENABLED: 0

- name: Create and checksum release archive
run: |
mkdir -p artifacts
pwd
set -eu -o pipefail
set -x
ls -lR artifacts .gotmp/bin
echo "# Archive checksums" > artifacts/checksums.txt
for item in darwin_amd64 darwin_arm64 linux_amd64 linux_arm64; do
pushd .gotmp/bin/${item} >/dev/null
cp -r ../completions/* .
ls -l $PWD
zip -v ../../../artifacts/ddev_${item}.zip ddev ddev_*completion* ddev_fig_spec.ts
popd >/dev/null
done
for item in windows_amd64 windows_arm64; do
pushd .gotmp/bin/${item} >/dev/null
zip -v ../../../artifacts/ddev_${item}.zip ddev.exe ddev*installer.exe
popd >/dev/null
done
# Create checksums
cd artifacts
sha256sum *.zip >>checksums.txt
# Do artifacts for upload to workflow URL
- name: Generate artifacts
run: ./.ci-scripts/generate_artifacts.sh ${{ github.workspace }}/artifacts

- name: Upload all artifacts
uses: actions/upload-artifact@v4
with:
name: ddev-head-artifacts
path: |
artifacts/*.zip
artifacts/checksums.txt
name: all-ddev-executables
path: ${{ github.workspace }}/artifacts/*
- name: Upload macos-amd64 binary
uses: actions/upload-artifact@v4
with:
name: ddev-macos-amd64
path: .gotmp/bin/darwin_amd64/ddev
- name: Upload macos-arm64 binary
uses: actions/upload-artifact@v4
with:
name: ddev-macos-arm64
path: .gotmp/bin/darwin_arm64/ddev
- name: Upload linux-arm64 binary
uses: actions/upload-artifact@v4
with:
name: ddev-linux-arm64
path: .gotmp/bin/linux_arm64/ddev
- name: Upload linux-amd64 binary
uses: actions/upload-artifact@v4
with:
name: ddev-linux-amd64
path: .gotmp/bin/linux_amd64/ddev
- name: Upload windows-amd64 binary
uses: actions/upload-artifact@v4
with:
name: ddev-windows-amd64
path: .gotmp/bin/windows_amd64/ddev.exe

- name: Upload windows_amd64 installer
uses: actions/upload-artifact@v4
with:
name: ddev-windows-amd64-installer
path: .gotmp/bin/windows_amd64/ddev_windows_amd64_installer*.exe
- name: Upload windows-arm64 binary
uses: actions/upload-artifact@v4
with:
name: ddev-windows-arm64
path: .gotmp/bin/windows_arm64/ddev.exe
- name: Upload windows_arm64 installer
uses: actions/upload-artifact@v4
with:
name: ddev-windows-arm64-installer
path: .gotmp/bin/windows_arm64/ddev_windows_arm64_installer*.exe

- name: Show github.ref
run: echo ${{ github.ref }}
Expand Down
61 changes: 28 additions & 33 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -185,33 +185,31 @@ brews:

custom_block: |
head do
url "https://github.com/{{ .Env.REPOSITORY_OWNER }}/ddev.git", branch: "master"
resource "ddev-artifacts" do
url "https://nightly.link/{{ .Env.REPOSITORY_OWNER }}/ddev/workflows/master-build/master/ddev-head-artifacts.zip"
url "https://github.com/ddev/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
end
end
install: |
if build.head?
resource("ddev-artifacts").unpack buildpath
# Get the appropriate inner zipfile based on architecture
os = OS.mac? ? "darwin" : "linux"
arch = Hardware::CPU.arm? ? "arm64" : "amd64"
inner_zip = "ddev_#{os}_#{arch}.zip"
system "unzip", "-o", inner_zip, "-d", buildpath
bin.install "ddev"
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"
resource("ddev-binary").stage do
system "unzip", "-o", Dir["*.zip"].first if Dir["*.zip"].any?
bin.install "ddev"
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"
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
test: |
system "#{bin}/ddev --version"
Expand All @@ -229,29 +227,26 @@ brews:
skip_upload: "false"
dependencies:
- name: mkcert

custom_block: |
head do
url "https://github.com/{{ .Env.REPOSITORY_OWNER }}/ddev.git", branch: "master"
resource "ddev-artifacts" do
url "https://nightly.link/{{ .Env.REPOSITORY_OWNER }}/ddev/workflows/master-build/master/ddev-head-artifacts.zip"
url "https://github.com/ddev/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
end
end
install: |
if build.head?
resource("ddev-artifacts").unpack buildpath
# Get the appropriate inner zipfile based on architecture
os = OS.mac? ? "darwin" : "linux"
arch = Hardware::CPU.arm? ? "arm64" : "amd64"
inner_zip = "ddev_#{os}_#{arch}.zip"
system "unzip", "-o", inner_zip, "-d", buildpath
bin.install "ddev"
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"
resource("ddev-binary").stage do
system "unzip", "-o", Dir["*.zip"].first if Dir["*.zip"].any?
bin.install "ddev"
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"
bash_completion.install "ddev_bash_completion.sh" => "ddev"
Expand Down

0 comments on commit 8d7384a

Please sign in to comment.