Skip to content

ci: attach generated command reference as a release asset - #97

Merged
aurokin merged 1 commit into
mainfrom
ci/release-docs-asset
May 24, 2026
Merged

ci: attach generated command reference as a release asset#97
aurokin merged 1 commit into
mainfrom
ci/release-docs-asset

Conversation

@aurokin

@aurokin aurokin commented May 24, 2026

Copy link
Copy Markdown
Owner

Follow-up to the docs reflection: closes the "consumers can't browse the command reference without a Go toolchain" gap by shipping it as a release asset (option 3), while keeping the in-repo tree generated-on-demand (not committed).

What changed

  • .goreleaser.yaml — two before.hooks generate the reference (gen-docs --product all) into a throwaway, gitignored dist-docs/ and tar it to atlassian-cli_docs.tar.gz; release.extra_files attaches that bundle next to the binary archives and checksums.txt. The rm -rf dist-docs first hook makes it idempotent, and --clean only wipes dist/, so the bundle survives into the publish stage.
  • .gitignore — add /dist-docs/.
  • docs/releasing.md, docs/consuming.md — document the new asset (name, atlassian-cli-docs/{jira,confluence,bitbucket}/ layout, and that the in-repo tree stays on-demand).

Validation

  • goreleaser check passes (v2.15.4, current v2 schema).
  • A full goreleaser release --snapshot --clean ran green: it executed the hooks and produced dist-docs/atlassian-cli_docs.tar.gz (185 command files across the three products, 33K), and built all 6 platform archives.
  • Bundle confirmed gitignored; doc links checked; make check green; passed codexrabbit-code-reviewer (verdict: correct).

One caveat

A snapshot exercises hook execution and bundle assembly but not the actual upload to a GitHub Release — that only runs on a real v* tag push. The config is structurally valid and the glob resolves from the repo root, so the upload is standard goreleaser extra_files behavior; it's just not provable without cutting a release.

🤖 Generated with Claude Code

Make GoReleaser ship the per-command Markdown reference as a standalone
release asset so consumers get a browsable command reference matched to the
release without a Go toolchain — while the in-repo tree stays generated on
demand (not committed).

Two `before` hooks generate the reference (`gen-docs --product all`) into a
throwaway, gitignored `dist-docs/` and tar it to `atlassian-cli_docs.tar.gz`;
`release.extra_files` attaches that bundle alongside the binary archives and
checksums. `--clean` only touches `dist/`, and the first hook `rm -rf`s the
docs dir, so the step is idempotent.

Validated with `goreleaser check` and a full `goreleaser release --snapshot
--clean`, which runs the hooks and produces the bundle (185 command files
across jira/confluence/bitbucket). The actual upload only runs on a real tag
push. docs/releasing.md and docs/consuming.md updated to describe the asset.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@aurokin
aurokin merged commit 6c24ed0 into main May 24, 2026
3 checks passed
@aurokin
aurokin deleted the ci/release-docs-asset branch May 24, 2026 17:02
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.

1 participant