ci: attach generated command reference as a release asset - #97
Merged
Conversation
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>
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.
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— twobefore.hooksgenerate the reference (gen-docs --product all) into a throwaway, gitignoreddist-docs/and tar it toatlassian-cli_docs.tar.gz;release.extra_filesattaches that bundle next to the binary archives andchecksums.txt. Therm -rf dist-docsfirst hook makes it idempotent, and--cleanonly wipesdist/, 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 checkpasses (v2.15.4, current v2 schema).goreleaser release --snapshot --cleanran green: it executed the hooks and produceddist-docs/atlassian-cli_docs.tar.gz(185 command files across the three products, 33K), and built all 6 platform archives.make checkgreen; passedcodexrabbit-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 goreleaserextra_filesbehavior; it's just not provable without cutting a release.🤖 Generated with Claude Code