fix(cd): allow GoReleaser to auto-detect monorepo tags and skip semver validation - #17
Conversation
WalkthroughThe workflow now extracts the full Git tag into a Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Dev as Developer
participant GH as GitHub Actions (cd.yml)
participant V as Version Step
participant S as Snapshot Job
participant R as Release Job
Dev->>GH: Push tag / trigger workflow
GH->>V: Run version extraction
V-->>GH: Outputs `tag` (full TAG) + log "Extracted full tag: ${TAG}"
GH->>S: Run snapshot path
note over S: env GORELEASER_CURRENT_TAG = steps.version.outputs.tag
GH->>R: Run release path
note over R: env GORELEASER_CURRENT_TAG = steps.version.outputs.tag
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🧪 Early access (Sonnet 4.5): enabledWe are currently testing the Sonnet 4.5 model, which is expected to improve code review quality. However, this model may lead to increased noise levels in the review comments. Please disable the early access features if the noise level causes any inconvenience. Note:
Comment |
a51a0c2 to
62d06c0
Compare
…lidation GoReleaser was failing with 'git tag v0.2.0 was not made against commit...' because: - The workflow was overriding GORELEASER_CURRENT_TAG with just the version (v0.2.0) - But the actual git tag created by release-please is the full monorepo format (protoc-gen-elixir-grpc@v0.2.0) Solution: - Remove GORELEASER_CURRENT_TAG override to let GoReleaser auto-detect the full tag name - Add --skip=validate flag to bypass semver parsing (since the tag format includes component prefix) GoReleaser correctly auto-detects the full tag and proceeds with the release when validation is skipped. Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
62d06c0 to
b386f44
Compare
Problem
The GoReleaser step in the CD workflow was failing with the error:
Root Cause Analysis
The workflow was overriding
GORELEASER_CURRENT_TAGwith just the semantic version (v0.2.0), but the actual git tag created by release-please uses the full monorepo format (protoc-gen-elixir-grpc@v0.2.0).When tested locally:
GORELEASER_CURRENT_TAG=v0.2.0→git tag v0.2.0 was not made against commit...❌GORELEASER_CURRENT_TAG=protoc-gen-elixir-grpc@v0.2.0→failed to parse tag as semver: invalid semantic version❌GORELEASER_CURRENT_TAGentirely → GoReleaser auto-detects the full tag correctly, but semver validation failsSolution
GORELEASER_CURRENT_TAG- Let GoReleaser auto-detect the tag from git (it correctly findsprotoc-gen-elixir-grpc@v0.2.0)--skip=validateflag - Bypass semver validation since our tags usecomponent@versionformatLocal Validation
Dry-run test confirmed the fix works:
BUILD_COMPONENT="protoc-gen-elixir-grpc" goreleaser release --clean --skip=publish,validateResults:
protoc-gen-elixir-grpc@v0.2.0protoc-gen-elixir-grpc@v0.2.0Impact
This fix enables the release workflow to properly handle monorepo tags for both:
protoc-gen-elixir-grpcprotoc-gen-connect-go-servicestructFixes: https://github.com/TrogonStack/protoc-gen/actions/runs/18118813863/job/51559613751