Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
70d56f7
ci: release
janishorsts Jan 2, 2026
ed1692a
Merge remote-tracking branch 'origin/main' into ci-release
janishorsts Jan 2, 2026
b76f9f9
ci: add permissions
janishorsts Jan 2, 2026
da76802
chore: lint
janishorsts Jan 2, 2026
0a38208
chore: tidy
janishorsts Jan 2, 2026
4457418
chore: tidy
janishorsts Jan 2, 2026
d44f5d4
chore: tidy
janishorsts Jan 7, 2026
8e82c75
fix: update to release version
gilescope Mar 1, 2026
0be1537
fix: point to earthbuild fork of homebrew core
gilescope Mar 1, 2026
a3ef93a
fix: probably not needed
gilescope Mar 1, 2026
e321319
Merge remote-tracking branch 'origin/main' into ci-release
janishorsts Mar 26, 2026
efd47c3
chore: +check
janishorsts Mar 26, 2026
bb2f4c9
ci: use macos in GHA
janishorsts Mar 26, 2026
b9ff7f8
chore: +check
janishorsts Mar 26, 2026
0c60b7b
chore: tidy
janishorsts Mar 26, 2026
a6da627
chore: tidy
janishorsts Mar 26, 2026
4fc3b92
chore: tidy
janishorsts May 15, 2026
d7d0577
chore: tidy
janishorsts May 15, 2026
59f2385
chore: tidy
janishorsts May 15, 2026
038fe2f
chore: tidy
janishorsts May 15, 2026
f08a473
Merge remote-tracking branch 'origin/main' into ci-release
janishorsts Jul 1, 2026
1612e8a
chore: publish to GH packages
janishorsts Jul 1, 2026
8a6a29c
chore: rm version
janishorsts Jul 1, 2026
e22790b
chore: WIP
janishorsts Jul 2, 2026
0a5d264
chore: fix rubocop style warning for chmod
janishorsts Jul 2, 2026
77c3df3
chore: update homepage to github repo
janishorsts Jul 2, 2026
eace42b
feat: automate Renovate GHA SHA256 checksum updates for binary-only r…
janishorsts Jul 2, 2026
6a9c60a
chore: tidy
janishorsts Jul 2, 2026
dfcc1a2
Merge remote-tracking branch 'origin/main' into ci-release
janishorsts Jul 2, 2026
e1f985b
chore: tidy
janishorsts Jul 2, 2026
653e0ab
chore: tidy
janishorsts Jul 2, 2026
9a15c9b
chore: tidy
janishorsts Jul 2, 2026
a9cd98a
chore: tidy
janishorsts Jul 2, 2026
bfcd527
chore: tidy
janishorsts Jul 2, 2026
8cd4d97
chore: tidy
janishorsts Jul 2, 2026
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
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
EARTHLY_INSTALLATION_NAME=earthbuild-tap
18 changes: 18 additions & 0 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,22 @@
":semanticCommits",
],
labels: ["renovate"],
customManagers: [
{
customType: "regex",
fileMatch: ["^Formula/earth\\.rb$"],
matchStrings: [
"version\\s+\"(?<currentValue>.*?)\""
],
datasourceTemplate: "github-tags",
depNameTemplate: "EarthBuild/earthbuild"
}
],
packageRules: [
{
matchPackageNames: ["EarthBuild/earthbuild"],
branchName: "release-v{{{newVersion}}}",
automerge: true
}
],
}
28 changes: 28 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: CI

on:
pull_request:

permissions: {}

jobs:
check:
runs-on: ubuntu-24.04
permissions:
contents: read
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
token: ${{ secrets.GITHUB_TOKEN }}
- uses: earthbuild/actions-setup@5d323543fa1d7b963384b46b2cbaef0bf6d88216 # v2.1.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Bootstrap buildkitd
run: earth bootstrap

- name: Lint
run: earth --ci +lint

- name: Test
run: earth --ci +test
36 changes: 36 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Release

on:
pull_request:
branches:
- main

permissions: {}

jobs:
update-sha:
permissions:
contents: write
runs-on: ubuntu-24.04-arm
if: github.actor == 'renovate[bot]' && startsWith(github.head_ref, 'release-v')
steps:
- name: Checkout PR branch
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
ref: ${{ github.event.pull_request.head.ref }}

- name: Update checksums
run: python3 scripts/update-checksums.py

- name: Commit and push changes
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
if ! git diff --exit-code Formula/earth.rb; then
git add Formula/earth.rb
git commit -m "chore: update sha256 checksums"
git push
else
echo "No checksum changes detected."
fi
128 changes: 0 additions & 128 deletions .github/workflows/test-and-publish.yml

This file was deleted.

2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
*.txt
earthbuild*.json
earthbuild*.tar.gz
81 changes: 81 additions & 0 deletions Earthfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
VERSION 0.8
FROM debian
ENV NONINTERACTIVE=1
ENV HOMEBREW_NO_AUTO_UPDATE=1
ENV PATH="/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:${PATH}"
WORKDIR /home/linuxbrew/earthbuild-tap
RUN apt-get update && apt-get install -y curl git ca-certificates procps sudo build-essential
RUN useradd -m -s /bin/bash linuxbrew && \
echo 'linuxbrew ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers && \
chown -R linuxbrew:linuxbrew /home/linuxbrew
USER linuxbrew
RUN git config --global --add safe.directory /home/linuxbrew/earthbuild-tap && \
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" && \
/home/linuxbrew/.linuxbrew/bin/brew developer on

src:
COPY --dir .git Formula .
RUN brew tap EarthBuild/tap . && brew trust EarthBuild/tap
SAVE ARTIFACT Formula
SAVE ARTIFACT .git

# check verifies the quality of the formula
check:
BUILD +lint
BUILD +test

# lint checks for Homebrew code quality
lint:
BUILD +info
BUILD +readall
BUILD +audit
BUILD +style
BUILD +fetch
BUILD +livecheck

# audit checks for Homebrew coding style violations
audit:
FROM +src
RUN brew audit --strict --online --except=specs --signing --debug --audit-debug EarthBuild/tap/earth

# style checks for conformance to Homebrew style guidelines
style:
FROM +src
RUN brew style --verbose --debug EarthBuild/tap/earth

# info checks that the formula parses correctly
info:
FROM +src
RUN brew info EarthBuild/tap/earth

# readall checks that all formulae in the tap can be successfully parsed
readall:
FROM +src
RUN brew readall EarthBuild/tap

# fetch verifies source URLs and sha256 checksums
fetch:
FROM +src
RUN brew fetch EarthBuild/tap/earth

# livecheck checks if there is a newer version available upstream
livecheck:
FROM +src
RUN brew livecheck EarthBuild/tap/earth

# test runs all tests
test:
BUILD +test-install
BUILD +test-formula

# test-install installs the pre-compiled binary
test-install:
FROM +src
RUN brew install EarthBuild/tap/earth
RUN earth --version

# test-formula runs the built-in 'test do' block defined in the formula
test-formula:
FROM +src
RUN brew install EarthBuild/tap/earth
RUN brew test --verbose --debug EarthBuild/tap/earth
64 changes: 41 additions & 23 deletions Formula/earth.rb
Original file line number Diff line number Diff line change
@@ -1,44 +1,62 @@
class Earth < Formula
desc "Build automation tool for the container era"
homepage "https://github.com/earthbuild"
url "https://github.com/EarthBuild/earthbuild.git",
tag: "v0.8.17",
revision: "52f2da6dd7f3de24a60a76e00044ec560b0ea407"
homepage "https://github.com/EarthBuild/earthbuild"
version "0.8.17"
license "MPL-2.0"
head "https://github.com/EarthBuild/earthbuild.git", branch: "main"

bottle do
sha256 cellar: :any_skip_relocation, arm64_tahoe: "194e4b767c3d1a551453ceb3739345c84de89533768b352e3b339d116497a238"
on_macos do
on_arm do
url "https://github.com/EarthBuild/earthbuild/releases/download/v#{version}/earth-darwin-arm64"
sha256 "2e0a5e7b5623e2bfdab3e0be6bbbcb772f1d2ad6562132fbc3c9ce5564a939c1"
end
on_intel do
url "https://github.com/EarthBuild/earthbuild/releases/download/v#{version}/earth-darwin-amd64"
sha256 "4ba8af21431b276edfacf8730e9372da1842ead0bc9bf0f6a014896afca97c96"
end
end

depends_on "go" => :build
on_linux do
on_arm do
url "https://github.com/EarthBuild/earthbuild/releases/download/v#{version}/earth-linux-arm64"
sha256 "bdc776167083e1bc4ec01379e88c6ae6372f52e4ea034e931865ff4ba030df63"
end
on_intel do
url "https://github.com/EarthBuild/earthbuild/releases/download/v#{version}/earth-linux-amd64"
sha256 "85b7f31020be220493c1ef89fe4e976985a72e54dd12b7dfcf17544c8d4fd880"
end
end

def install
ENV["CGO_ENABLED"] = "0"
ldflags = %W[
-s -w
-X main.DefaultBuildkitdImage=docker.io/earthly/buildkitd:v0.8.16
-X main.Version=v#{version}
-X main.GitSha=#{Utils.git_head}
-X main.BuiltBy=homebrew-earthbuild
]
tags = "dfrunmount dfrunsecurity dfsecrets dfssh dfrunnetwork dfheredoc forceposix"
system "go", "build", "-tags", tags, *std_go_args(ldflags: ldflags, output: bin/"earthly"), "./cmd/earthly"
binary_name = if OS.mac?
Hardware::CPU.arm? ? "earth-darwin-arm64" : "earth-darwin-amd64"
else
Hardware::CPU.arm? ? "earth-linux-arm64" : "earth-linux-amd64"
end

bin.install_symlink "earthly" => "earth"
chmod 0755, binary_name
bin.install binary_name => "earth"
bin.install_symlink "earth" => "earthly"

generate_completions_from_executable(bin/"earth", "bootstrap", "--source", shells: [:bash, :zsh])
end

def caveats
<<~EOS
EarthBuild requires a container runtime to function.
If you don't have one, you can install Docker or Podman:
brew install --cask docker
OR
brew install podman
EOS
end

test do
# earthbuild requires docker to run; therefore doing a complete end-to-end test here is not
# possible; however the "earthbuild ls" command is able to run without docker.
(testpath/"Earthfile").write <<~EOS
(testpath / "Earthfile").write <<~EOS
VERSION 0.8
mytesttarget:
\tRUN echo Homebrew
EOS
output = shell_output("#{bin}/earthly ls")
output = shell_output("#{bin}/earth ls")
Comment thread
janishorsts marked this conversation as resolved.
assert_match "+mytesttarget", output
end
end
Loading