forked from earthly/homebrew-earthly
-
Notifications
You must be signed in to change notification settings - Fork 1
ci: release #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
ci: release #7
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
70d56f7
ci: release
janishorsts ed1692a
Merge remote-tracking branch 'origin/main' into ci-release
janishorsts b76f9f9
ci: add permissions
janishorsts da76802
chore: lint
janishorsts 0a38208
chore: tidy
janishorsts 4457418
chore: tidy
janishorsts d44f5d4
chore: tidy
janishorsts 8e82c75
fix: update to release version
gilescope 0be1537
fix: point to earthbuild fork of homebrew core
gilescope a3ef93a
fix: probably not needed
gilescope e321319
Merge remote-tracking branch 'origin/main' into ci-release
janishorsts efd47c3
chore: +check
janishorsts bb2f4c9
ci: use macos in GHA
janishorsts b9ff7f8
chore: +check
janishorsts 0c60b7b
chore: tidy
janishorsts a6da627
chore: tidy
janishorsts 4fc3b92
chore: tidy
janishorsts d7d0577
chore: tidy
janishorsts 59f2385
chore: tidy
janishorsts 038fe2f
chore: tidy
janishorsts f08a473
Merge remote-tracking branch 'origin/main' into ci-release
janishorsts 1612e8a
chore: publish to GH packages
janishorsts 8a6a29c
chore: rm version
janishorsts e22790b
chore: WIP
janishorsts 0a5d264
chore: fix rubocop style warning for chmod
janishorsts 77c3df3
chore: update homepage to github repo
janishorsts eace42b
feat: automate Renovate GHA SHA256 checksum updates for binary-only r…
janishorsts 6a9c60a
chore: tidy
janishorsts dfcc1a2
Merge remote-tracking branch 'origin/main' into ci-release
janishorsts e1f985b
chore: tidy
janishorsts 653e0ab
chore: tidy
janishorsts 9a15c9b
chore: tidy
janishorsts a9cd98a
chore: tidy
janishorsts bfcd527
chore: tidy
janishorsts 8cd4d97
chore: tidy
janishorsts File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| EARTHLY_INSTALLATION_NAME=earthbuild-tap |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1 @@ | ||
| *.txt | ||
| earthbuild*.json | ||
| earthbuild*.tar.gz |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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") | ||
| assert_match "+mytesttarget", output | ||
| end | ||
| end | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.