-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Create a new GitHub Action, setup-same, to automate the installation and configuration of the same binary in CI/CD pipelines. This action will allow users to easily onboard same into their workflows without manually managing release downloads or path configuration.
This action will be published to the Marketplace and used in user workflows (e.g., .github/workflows/ci.yml).
Goals
- Provide a seamless "zero-config" experience for installing the latest version of
same. - Support deterministic builds by allowing users to pin specific versions.
- Optimize CI performance by leveraging the GitHub Actions tool cache.
- Support all platforms currently targeted by our release pipeline (Linux/macOS, amd64/arm64).
Acceptance Criteria
Interface
- Inputs
version: (Optional) The version to install (e.g.,v0.0.1,0.0.1). Defaults tolatest.github-token: (Optional) Used to query the GitHub API to avoid rate limits. Defaults to${{ github.token }}.
- Outputs
version: The actual version number installed.cache-hit: Boolean (true/false) indicating if the binary was served from the local cache.
Functional Logic
- Platform Detection: Automatically detect the runner's OS and Architecture.
- Support:
Linux,macOS. - Support:
amd64(x64),arm64. - Note: Windows is explicitly not supported.
- Support:
- Version Resolution:
- If
latestis requested, query the GitHub Releases API to find the most recent tag. - If a specific version is provided, use it directly.
- Sanitize the version string to ensure correct filename construction (stripping
vprefix if necessary).
- If
- Asset Download:
- Construct the download URL based on the
goreleasernaming convention found inrelease.yml:same_{VERSION}_{OS}_{ARCH}.tar.gz. - Mappings:
- Linux →
linux - macOS →
macOS(Case sensitive) - amd64 →
x86_64 - arm64 →
arm64
- Linux →
- Construct the download URL based on the
- Installation:
- Download and extract the archive.
- Install the binary into the runner's tool cache using
@actions/tool-cache. - Prepend the binary path to
$GITHUB_PATH.
- Verification:
- Execute
same --versionto verify the installation was successful.
- Execute
Implementation Details
- Built using Node.js 20.
- Uses
@actions/core,@actions/tool-cache, and@actions/http-client.
Metadata
Metadata
Assignees
Labels
No labels