Skip to content

ci: add stable release workflow - #23

Merged
somanshreddy merged 2 commits into
mainfrom
04-01-ci_add_release_workflow_for_goreleaser_on_tag_push
Apr 6, 2026
Merged

somanshreddy merged 2 commits into
mainfrom
04-01-ci_add_release_workflow_for_goreleaser_on_tag_push

Conversation

@somanshreddy

@somanshreddy somanshreddy commented Apr 1, 2026 •

Copy link
Copy Markdown
Collaborator

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:

Testing

Workflow syntax validated. GoReleaser config tested by goreleaser-check CI job. Version validation tested manually with valid/invalid inputs.

somanshreddy commented Apr 1, 2026 •

Copy link
Copy Markdown
Collaborator Author

@somanshreddy somanshreddy changed the title ci: add release workflow for GoReleaser on tag push ci: add GoReleaser release workflow (M3) Apr 1, 2026
@somanshreddy somanshreddy added this to the M4: Alpha Release milestone Apr 3, 2026
@somanshreddy
somanshreddy force-pushed the 04-01-ci_add_release_workflow_for_goreleaser_on_tag_push branch from aa2c356 to ce452f9 Compare April 6, 2026 19:52
@somanshreddy somanshreddy changed the title ci: add GoReleaser release workflow (M3) ci: add stable release workflow Apr 6, 2026
@somanshreddy
somanshreddy marked this pull request as ready for review April 6, 2026 20:09
@somanshreddy
somanshreddy requested a review from jrusso1020 April 6, 2026 20:26
somanshreddy and others added 2 commits April 6, 2026 23:27
Triggers on v* tags. Runs tests, then GoReleaser builds 6 binaries
(linux/darwin/windows × amd64/arm64), creates GitHub Release with
checksums. Version injected from git tag via ldflags.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@somanshreddy
somanshreddy force-pushed the 04-01-ci_add_release_workflow_for_goreleaser_on_tag_push branch from ce452f9 to 182a6a1 Compare April 6, 2026 23:28
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 commented Apr 6, 2026 •

Copy link
Copy Markdown
Collaborator Author

Merge activity

  • Apr 6, 11:42 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Apr 6, 11:43 PM UTC: @somanshreddy merged this pull request with Graphite.

@somanshreddy
somanshreddy merged commit 5bd6e8a into main Apr 6, 2026
20 of 23 checks passed
@somanshreddy
somanshreddy deleted the 04-01-ci_add_release_workflow_for_goreleaser_on_tag_push branch April 6, 2026 23:43
somanshreddy added a commit that referenced this pull request Apr 6, 2026
## 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 `dev` tag with unversioned assets (`heygen_linux_amd64.tar.gz`) and `version="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 from `v0.0.1-dev.*`.

**2. Install script rewrite (`scripts/install.sh`):**
The old installer defaulted to the `dev` tag and required `GITHUB_TOKEN`. The new installer:
- Defaults to latest stable release (not dev)
- `--dev` flag installs latest dev prerelease
- `--version v0.1.0` pins to a specific version (`v` prefix required)
- Falls back to unauthenticated GitHub API when no token is available (ready for public repo)
- Uses versioned GoReleaser asset names (`heygen_v0.1.0_linux_amd64.tar.gz`)
- `--help` flag for discoverability
- `--dev` and `--version` are mutually exclusive

**3. GoReleaser asset naming (`.goreleaser.yaml`):**
Archive name template changed from `{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}` to `{{ .ProjectName }}_v{{ .Version }}_{{ .Os }}_{{ .Arch }}` — includes the `v` prefix 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 via `make goreleaser-check`.
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.

2 participants