Một mục mã nguồn mở trong kho dữ liệu GitHub của TopGit: cli/gh-extension-precompile, 134 sao, Shell. Action for publishing binary GitHub CLI extensions
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
A GitHub CLI extension is any GitHub repository named gh-* that publishes a Release with precompiled binaries. This GitHub Action can be used in your extension repository to automate the creation and publishing of those binaries.
Go extensions
[!Note]
With the use of actions/setup-go@v5 for Go extensions, cache is enabled by default as part of the action's v4 release. The action won’t throw an error if the cache can’t be restored or saved. The action will throw a warning message but it won’t stop a build process.
Create a workflow file at .github/workflows/release.yml:
Then, either push a new git tag like v1.0.0 to your repository, or create a new Release and have it initialize the associated git tag.
When the release workflow finishes running, compiled binaries will be uploaded as assets to the v1.0.0 Release and your extension will be installable by users of gh extension install on supported platforms.
You can safely test out release automation by creating tags that have a - in them; for example: v2.0.0-rc.1. Such Releases will be published as prereleases and will not count as a stable release of your extension.
To maximize portability of built products, this action builds Go binaries with cgo disabled with the exception of Android build targets. To override cgo for all build targets, set the CGO_ENABLED environment variable:
gh-extension-precompile@v2 introduces a breaking change by disabling android-arm64 and android-amd64 build targets by default due to Go external linking requirements.
To enable Android build targets:
release_android must be set to true
android_sdk_version must be set to a targeted Android API level
android_ndk_home must be set to the path to Android NDK installed on Actions runner
cli/gh-extension-precompile will use pre-installed Android tools on GitHub-managed runners by default; self-hosted runners will need to install and configure this input.
For more information on Android NDK installed on GitHub-managed runners, see actions/runner-images
Customizing the build process for Go extensions
If you only need to customize the go build command, the go_build_options input parameter can include additional flags and arguments for all platforms:
For more complex customizations, see Extensions written in other compiled languages to provide a custom build script.
Extensions written in other compiled languages
If you aren't using Go for your compiled extension, or your Go extension requires customizations to the build script, you'll need to provide your own script for compiling your extension:
The build script will receive the release tag name as the first argument.
This script must produce executables in a dist directory with file names ending with: {os}-{arch}{ext}, where the extension is .exe on Windows and blank on other platforms. For example:
dist/gh-my-ext_v1.0.0_darwin-amd64
dist/gh-my-ext_v1.0.0_windows-386.exe
For valid {os}-{arch} combinations, see the output of go tool dist list with the Go version you intend to use for compiling.
Potentially useful environment variables available in your build script:
GITHUB_REPOSITORY: name of your extension repository in owner/repo format
GITHUB_TOKEN: auth token with access to GITHUB_REPOSITORY
Checksum file and signing
This action can optionally produce a checksum file for all published executables and sign it with GPG.
To enable this, make sure your repository has the secrets GPG_SECRET_KEY and GPG_PASSPHRASE set. (Tip: you can use gh secret set for this; follow the instructions here to obtain the correct secret values.) Then, configure this action like so:
cli/gh-extension-precompile có 134 sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/cli/gh-extension-precompile. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
cli/gh-extension-precompile có tag gì không?
Bản đồng bộ chưa ghi nhận topic GitHub nào cho cli/gh-extension-precompile. GitHub topics hiển thị ở thanh bên phải trang repo — đó là nơi đáng kiểm tra nhất.
cli/gh-extension-precompile có website riêng không?
TopGit chưa ghi nhận URL trang chủ cho cli/gh-extension-precompile. Phần README ở tab phía trên thường có link demo, hoặc xem mô tả GitHub của repo.
cli/gh-extension-precompile còn đang phát triển không?
Commit gần nhất trên cli/gh-extension-precompile là 2 tháng trước (theo timestamp GitHub). Repo có 64 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
cli/gh-extension-precompile dùng license gì?
cli/gh-extension-precompile phát hành theo license MIT. Nên mở file LICENSE trên GitHub để xác nhận — license metadata đôi khi lệch với thực tế dự án.
cli/gh-extension-precompile viết bằng ngôn ngữ gì?
cli/gh-extension-precompile chủ yếu viết bằng Shell. Trường "language" của GitHub dựa trên phần lớn byte ở nhánh mặc định.
Đọc thêm về cli/gh-extension-precompile ở đâu?
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/cli/gh-extension-precompile là nguồn chính thức.
Đọc đầy đủ README ở tab phía trên.
gh-extension-precompile có đáng để bạn bỏ thời gian?
ChatGPT, Claude và Perplexity đều đọc được trang này. Hỏi thử xem họ nghĩ gì về gh-extension-precompile.