Repository navigation
scripts: rewrite installer for versioned releases - #49
Merged
somanshreddy merged 5 commits intoApr 6, 2026
Merged
Conversation
Collaborator
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
This was referenced Apr 6, 2026
somanshreddy
marked this pull request as ready for review
April 6, 2026 20:09
jrusso1020
reviewed
Apr 6, 2026
jrusso1020
approved these changes
Apr 6, 2026
somanshreddy
force-pushed
the
04-06-scripts_rewrite_installer_for_versioned_releases
branch
from
April 6, 2026 23:28
b375061 to
5066125
Compare
somanshreddy
force-pushed
the
04-01-ci_add_release_workflow_for_goreleaser_on_tag_push
branch
from
April 6, 2026 23:28
ce452f9 to
182a6a1
Compare
somanshreddy
added a commit
that referenced
this pull request
Apr 6, 2026
## Description Adds a `.gitleaks.toml` allowlist so the PostHog project API token in `internal/analytics/analytics.go` doesn't fail the secrets CI check. PostHog project tokens are public client-side ingest tokens by design — they're embedded in every frontend and CLI that uses PostHog. This is not a secret leak. The allowlist is scoped narrowly: only matches the exact `const posthogAPIKey = "phc_..."` assignment in that one file. Without this, the `secrets` CI job fails on PRs #23, #49, and #50 (the entire M6 stack). ## Testing CI `secrets` job should pass after this merges. Verified the allowlist regex matches the token assignment pattern.
somanshreddy
changed the base branch from
04-01-ci_add_release_workflow_for_goreleaser_on_tag_push
to
graphite-base/49
April 6, 2026 23:42
somanshreddy
added a commit
that referenced
this pull request
Apr 6, 2026
## Description Adds a manual GitHub Actions workflow for cutting stable releases. This is the first PR in the M6 release cycle stack (#23 → #49 → #50). ### Versioning Strategy The CLI uses semver with a `v` prefix everywhere — git tags, `--version` output, `--version` flag input, JSON responses, install script. | Build type | Tag format | Example | How triggered | |---|---|---|---| | **Stable** | `v{major}.{minor}.{patch}` | `v0.1.0` | Manual — GitHub Actions UI, operator inputs version | | **Dev** | `v{base}-dev.{YYYYMMDD}.{shorthash}` | `v0.1.1-dev.20260406.abc1234` | Manual — GitHub Actions UI, version auto-computed | | **Local** | — | `dev` | `go build` without ldflags | **Semver ordering:** `v0.2.0` > `v0.1.1-dev.20260407.def` > `v0.1.1-dev.20260406.abc` > `v0.1.0`. Stable always beats prerelease. Dev builds sort chronologically by date. **Dev version auto-derivation (PR #49):** The dev workflow reads the latest stable tag, bumps patch (`v0.1.0` → `v0.1.1`), and appends `-dev.YYYYMMDD.SHORTHASH`. No VERSION file, no manual bumps. Dev builds always sort above the latest stable. **Bumping rules:** Pre-1.0 (`v0.x.y`): minor = features, patch = fixes, no stability guarantees. Post-1.0: full semver contract. ### This PR — Stable Release Workflow **Trigger:** GitHub Actions UI → "Stable Release" → input version tag (e.g., `v0.1.0`) → "Run workflow" **What it does:** 1. Validates version is semver format (`v0.1.0` — rejects `1.0` or `foo`) 2. Validates the tag doesn't already exist (prevents accidental overwrite) 3. Runs tests 4. Creates git tag on current `main` HEAD 5. GoReleaser builds platform binaries + `checksums.txt`, publishes as a stable GitHub release **Downstream PRs:** - PR #49 — rewrites dev release workflow + installer for versioned assets - PR #50 — adds `heygen update` / `heygen update check` commands (channel-aware: stable users get stable updates, dev users get dev updates) ## Testing Workflow syntax validated. GoReleaser config tested by `goreleaser-check` CI job. Version validation tested manually with valid/invalid inputs.
Add format table, semver ordering examples, dev version auto-derivation explanation, bumping rules, and update channel detection. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Set HEYGEN_CONFIG_DIR to an empty temp dir in runCommand() so FileCredentialResolver doesn't pick up real credentials from ~/.heygen/credentials on dev machines. Skips the override if the test already set HEYGEN_CONFIG_DIR (e.g., config tests that write a config file to a specific dir). Fixes TestVideoDownload_AuthRequired and TestVideoList_AuthMissing which failed on machines with stored credentials. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
SKILL.md is agent-facing — agents should install the stable release, not dev builds. Dev install instructions stay in README.md and RELEASE.md. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
somanshreddy
force-pushed
the
04-06-scripts_rewrite_installer_for_versioned_releases
branch
from
April 6, 2026 23:43
5066125 to
a7c9b3f
Compare
somanshreddy
force-pushed
the
graphite-base/49
branch
from
April 6, 2026 23:43
182a6a1 to
5bd6e8a
Compare
Remove exit codes, flag details, pagination, and --output-path notes — all derivable from --help. Keep: install, auth, async workflow pattern, output contract, schema discovery, and key gotchas. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
somanshreddy
force-pushed
the
04-06-scripts_rewrite_installer_for_versioned_releases
branch
from
April 6, 2026 23:43
a7c9b3f to
dd325d3
Compare
Collaborator
Author
Merge activity
|
somanshreddy
deleted the
04-06-scripts_rewrite_installer_for_versioned_releases
branch
April 6, 2026 23:54
somanshreddy
added a commit
that referenced
this pull request
Apr 7, 2026
## Description
Adds `heygen update` and `heygen update check` — explicit self-update commands for the CLI. No auto-update, no startup notifications, no network calls in `--help` or `--version`.
**`heygen update check`** — queries GitHub Releases for the latest stable version, returns JSON:
```json
{"current": "v0.1.0", "latest": "v0.2.0", "update_available": true}
```
**`heygen update`** — downloads the latest stable release, verifies SHA256 checksum, replaces the binary. Returns JSON:
```json
{"previous": "v0.1.0", "current": "v0.2.0", "message": "Updated heygen from v0.1.0 to v0.2.0"}
```
**`heygen update --version v0.1.0`** — pins to a specific version. The `v` prefix is required; bare `0.1.0` returns exit 2 (usage error).
**Design decisions:**
- `skipAuth: true` — no HeyGen API key needed. GitHub Releases are the source.
- GitHub token sourced from `GITHUB_TOKEN` → `GH_TOKEN` → `gh auth token` (same chain as the installer). Empty token works once the repo is public.
- Package manager detection: if binary is under `/homebrew/`, `/Cellar/`, `/linuxbrew/`, or `node_modules/`, returns a `CLIError` telling the user to use their package manager instead.
- Local `dev` builds (no ldflags) get a clear error: "reinstall from a release build to use heygen update."
- `releaseUpdater` interface abstracts `go-selfupdate` for testability. All tests use a mock — no real GitHub API calls.
- Static hint in root `--help`: `Use "heygen update check" to see if a newer version is available.` No dynamic notifications.
- `version` field added to `cmdContext` to pass the build-time version string to the update command.
**Dependencies added:** `creativeprojects/go-selfupdate` (GitHub Releases source, checksum validation, atomic binary replacement, rollback on failure) and `Masterminds/semver` (version parsing and validation).
Stacked on PR #49 (installer rewrite).
## Testing
7 tests with mock `releaseUpdater`:
- `TestUpdateCheck_NewVersionAvailable` — newer version returns `update_available: true`
- `TestUpdateCheck_AlreadyCurrent` — same version returns `update_available: false`
- `TestUpdateCheck_LocalDevVersion` — `dev` build returns exit 1 with "not release-tagged" error
- `TestUpdate_SkipsAuth` — no API key needed, exit 0
- `TestUpdate_PackageManagerWarning` — Homebrew path returns `wrong_install_method` error with brew hint
- `TestUpdate_JSONOutput` — success returns valid JSON with previous/current/message
- `TestUpdate_RejectsBareVersion` — `--version 0.1.0` (no `v`) returns exit 2
Root help test updated to verify the static update hint line.
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
Replaces the dev-phase installer and release workflow with a versioned release cycle. Three changes:
1. Dev release workflow rewrite (
.github/workflows/dev-release.yml):The old workflow used a rolling
devtag with unversioned assets (heygen_linux_amd64.tar.gz) andversion="dev-<sha>". The new workflow auto-computes a semver-compliant tag from the latest stable release: bumps patch, appends-dev.YYYYMMDD.SHORTHASH(e.g.,v0.1.1-dev.20260406.abc1234). Creates an immutable git tag and delegates to GoReleaser for versioned asset names, checksums, and prerelease publishing. Each dev build is a separate prerelease, not a rolling overwrite.Version derivation: reads latest stable tag via
git tag --list, bumps patch (v0.1.0→v0.1.1), appends dev metadata. If no stable tag exists, starts fromv0.0.1-dev.*.2. Install script rewrite (
scripts/install.sh):The old installer defaulted to the
devtag and requiredGITHUB_TOKEN. The new installer:--devflag installs latest dev prerelease--version v0.1.0pins to a specific version (vprefix required)heygen_v0.1.0_linux_amd64.tar.gz)--helpflag for discoverability--devand--versionare mutually exclusive3. GoReleaser asset naming (
.goreleaser.yaml):Archive name template changed from
{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}to{{ .ProjectName }}_v{{ .Version }}_{{ .Os }}_{{ .Arch }}— includes thevprefix in the filename for consistency with the tag format.README, RELEASE.md, and SKILL.md updated to reflect the new install commands and versioning scheme.
Stacked on PR #23 (stable release workflow).
Testing
Install script tested manually with
--help,--dev,--version, and default (stable) modes. Dev release workflow validated by reading the computed version step output. GoReleaser config validated viamake goreleaser-check.