ci: add internal dev release workflow (PRINFRA-138)#35
Merged
Conversation
Collaborator
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
This was referenced Apr 2, 2026
PRINFRA-138 CLI: Install script + Homebrew tap
Set up Phase 1 distribution: install script and Homebrew tap. Scope
Acceptance Criteria
|
Collaborator
Author
Merge activity
|
somanshreddy
added a commit
that referenced
this pull request
Apr 3, 2026
## Description Adds `scripts/install.sh` — a one-command installer for internal users who don't have Go. Downloads the latest dev build from the rolling `dev` prerelease (PR #35) and installs to `~/.local/bin`. **Install or update (same command):** ```bash # If you have gh CLI authenticated: bash <(gh api repos/heygen-com/heygen-cli/contents/scripts/install.sh --jq '.content' | base64 -d) # Or with a GitHub token: export GITHUB_TOKEN=<token> curl -fsSL -H "Authorization: token $GITHUB_TOKEN" \ https://raw.githubusercontent.com/heygen-com/heygen-cli/main/scripts/install.sh | bash ``` **What the script does:** 1. Detects OS (`darwin`/`linux`) and architecture (`amd64`/`arm64`) 2. Downloads the matching archive from the `dev` prerelease 3. Downloads `checksums.txt` and verifies the archive SHA256 hash 4. Extracts the `heygen` binary 5. Installs to `~/.local/bin` with `0755` permissions 6. Runs `heygen --version` to verify the install 7. Warns if `~/.local/bin` is not in PATH **Auth handling** (private repo requires authentication): - Primary path: `gh release download` — works if user has `gh` CLI installed and authenticated (most internal devs do) - Fallback: `curl` with `GITHUB_TOKEN` or `GH_TOKEN` environment variable - Fails with a clear message if neither auth method is available **Safety:** - Checksum verification catches corrupted or tampered downloads - `set -euo pipefail` — strict bash mode, fails fast on errors - Temp directory with cleanup trap — no leftover files on failure - SHA256 tool detection: `sha256sum` (Linux) or `shasum -a 256` (Mac) **Testing overrides:** - `HEYGEN_RELEASE_BASE_URL` — point downloads at a local directory for testing - `INSTALL_DIR` — install to a custom directory - `HEYGEN_RELEASE_TAG` — download a specific release tag instead of `dev` **What the user sees:** ``` Detected: linux amd64 Installing heygen from heygen-com/heygen-cli release tag 'dev' Downloaded release assets with gh Installed: /home/user/.local/bin/heygen heygen version dev-08bd87d ``` Depends on PR #35 for the dev release workflow that produces the artifacts this script downloads. Linear: PRINFRA-138 ## Testing - `bash -n scripts/install.sh` — syntax check passes - Tested end-to-end against a real `dev` prerelease on GitHub — download, checksum verify, install, version check all pass - Tested `gh` download path (primary) — clean output, no stderr leaks - Tested `curl` fallback with `HEYGEN_RELEASE_BASE_URL=file:///tmp/...` — works for local testing - Tested checksum failure detection — corrupted archive correctly rejected with clear error - Tested PATH hint — shown when `~/.local/bin` is not in PATH
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

Description
Adds a manual GitHub Actions workflow for internal dev releases. When triggered, it builds CLI binaries for 5 platforms and publishes them to a single rolling GitHub prerelease.
Trigger:
workflow_dispatch(manual) — run viagh workflow run dev-release.ymlor the Actions UI. No automatic runs on push/merge, keeping GitHub Actions costs controlled on the private org repo.What it does:
mainat the latest commitmake test— workflow fails if tests don't pass (no broken binaries released)CGO_ENABLED=0(fully static binaries)dev-<sha>via ldflagsdevprerelease (if any) and creates a fresh one with the new assetsPlatforms:
heygen_linux_amd64.tar.gzheygen_linux_arm64.tar.gzheygen_darwin_amd64.tar.gzheygen_darwin_arm64.tar.gzheygen_windows_amd64.zipchecksums.txtDesign choices:
go build+gh releaseinstead of GoReleaser — GoReleaser expects immutable semver tags, which conflicts with a rollingdevprerelease. GoReleaser is reserved for stable tagged releases.heygen --version.concurrency: cancel-in-progress: false— if triggered twice, the second run queues instead of canceling the first.Release notes are auto-generated with commit SHA, date, message, and who triggered the build.
The install script (PR #36) sits on top of this workflow. This PR only handles building and publishing artifacts.
Linear: PRINFRA-138
Testing
sha256sumchecksums matchdevprerelease on GitHub, confirmed assets upload correctlyTestVideoList_AuthMissingfails on main — pre-existing, unrelated to this PR