Skip to content
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

buildx: install release binaries from a fork #127

Closed
wants to merge 2 commits into from

Conversation

nicks
Copy link

@nicks nicks commented Jul 3, 2023

adds a new API method that uses the github releases API to find the appropriate version to download.

@nicks
Copy link
Author

nicks commented Jul 3, 2023

loosely based on nicks/setup-buildx-action@e277290

The old approach always built from scratch, which added about 2 minutes to the CI pipeline. The new approach takes 30s (from cold cache) or 2s (if the tool is cached).

@nicks nicks force-pushed the nicks/release-fork branch 2 times, most recently from d299bba to c0a58e2 Compare July 3, 2023 22:31
Copy link
Member

@crazy-max crazy-max left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

loosely based on nicks/setup-buildx-action@e277290

The old approach always built from scratch, which added about 2 minutes to the CI pipeline. The new approach takes 30s (from cold cache) or 2s (if the tool is cached).

If the idea is to be able to download from GitHub releases, let's just detect if a GH release-like URL is set in version like https://github.com/crazy-max/buildx/releases/tag/v0.10.4%2Blocalstate2 and avoid using a Git-like URL that can be confusing.

This way we would not need an extra installReleaseFromFork method but just check in download if version is GH release URL:

const release: GitHubRelease = await Install.getRelease(version);

src/buildx/install.ts Outdated Show resolved Hide resolved
src/buildx/install.ts Outdated Show resolved Hide resolved
src/toolkit.ts Outdated Show resolved Hide resolved
@nicks nicks force-pushed the nicks/release-fork branch 2 times, most recently from a0a9ebd to ebc4150 Compare July 3, 2023 23:10
adds a new API method that uses the github releases API
to find the appropriate version to download.

Signed-off-by: Nick Santos <nick.santos@docker.com>
@nicks nicks force-pushed the nicks/release-fork branch 2 times, most recently from 50d4386 to f0845cb Compare July 5, 2023 19:32
@nicks nicks requested a review from crazy-max July 5, 2023 19:33
@nicks
Copy link
Author

nicks commented Jul 5, 2023

thanks @crazy-max ! I cut a new version of this PR based on your comments. After this PR:

  • the download() function can download binaries from private forks
  • the download() codepath uses the github api to fetch release. we no longer read from buildx-releases.json

PTAL?

This will also require some changes downstream to make this work (right now, setup-buildx-action doesn't even go down the download() code path if it sees a URL)

…rivate forks

Signed-off-by: Nick Santos <nick.santos@docker.com>
@nicks
Copy link
Author

nicks commented Jul 10, 2023

I'm going to back this change out for now. The hosted tool cache is a good stop gap. We'll revisit it if we need it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants