Skip to content

Release flow#26

Merged
Joeavaikath merged 9 commits into
migtools:mainfrom
Joeavaikath:release-flow
Jul 18, 2025
Merged

Release flow#26
Joeavaikath merged 9 commits into
migtools:mainfrom
Joeavaikath:release-flow

Conversation

@Joeavaikath

@Joeavaikath Joeavaikath commented Jul 17, 2025

Copy link
Copy Markdown
Contributor

Add automated krew manifest generation and release workflow

🎯 What This PR Does

Adds automated release pipeline with krew plugin manifest generation for seamless distribution.

🚀 Key Features

Automated Krew Manifest Generation

  • Template-based oadp.yaml with environment variable substitution
  • Automatically populates real SHA256 checksums and version numbers
  • Generates production-ready oadp.yaml file as release artifact
  • No more manual checksum copying or version updates

Release Automation

  • Tag-triggered releases (git tag v0.1.0 && git push origin v0.1.0)
  • Creates GitHub releases with all platform binaries
  • Includes checksums.txt and ready-to-use krew manifest
  • Clean envsubst-based templating for maintainable workflow

Archive Creation Fixes

  • Proper platform filtering (only builds krew-supported architectures in releases)
  • Fixed Windows binary naming issues (.exe handling)
  • Consistent tar.gz archive naming across all platforms

📦 Release Artifacts

Each release now provides:

  • Platform-specific binaries for all supported architectures
  • SHA256 checksums for verification
  • oadp.yaml - Final krew manifest ready for index submission

🔧 Technical Improvements

  • Environment variable templating instead of fragile string replacement
  • Explicit platform filtering (prevents extra architectures in release)
  • Fixed Windows .exe binary archive naming
  • Comprehensive error handling and validation

🎁 Benefits

  • For maintainers: Automated releases, no manual manifest editing
  • For users: Reliable installation via krew
  • For krew index: Ready-to-submit manifests with correct checksums

Ready for krew index submission - just download oadp.yaml from releases and submit to kubernetes-sigs/krew-index! 🎉

📋 Files Added/Modified

  • .github/workflows/release.yml - New automated release pipeline
  • oadp.yaml - Converted to template for automated generation
  • tests/common.go - Windows compatibility fixes (if needed)

🧪 Testing

The workflow has been tested with multiple release cycles and successfully:

  • ✅ Generates correct SHA256 checksums for all platforms
  • ✅ Creates valid krew manifest with real values
  • ✅ Produces properly named archives for krew compatibility

- Triggers on version tags (v*)
- Builds all 6 architectures using existing make release-build
- Creates proper tar.gz archives with LICENSE
- Generates SHA256 checksums
- Creates GitHub release with all artifacts
- Disable Go cache to avoid tar restoration conflicts
- Add explicit cache cleaning for fresh builds
- Download and verify dependencies explicitly
- Ensures clean build environment for releases
- Generate final kubectl-oadp.yaml with real SHA256 checksums
- Use Python for readable and maintainable string processing
- Include final manifest as release artifact
- Update release notes with installation instructions
- Ready for krew index submission automation
- Use v0.0.0 as template version placeholder
- All URLs now use consistent template version
- Add missing windows-arm64 platform (matches workflow builds)
- Ready for Python automation to populate real versions and SHA256s
✨ Major improvements:
- Convert oadp.yaml to environment variable template
- Replace complex Python regex with clean envsubst
- Much more readable and maintainable approach
- Robust error handling and validation
- Template uses ${VERSION}, ${LINUX_AMD64_SHA}, etc.

🔧 Technical benefits:
- No more fragile regex string replacement
- Standard environment variable substitution
- Easier to debug and modify
- Less code, more reliable
🎯 Perfect for krew index submission:
- Generate oadp.yaml directly (not oadp-final.yaml)
- Release artifact is ready to drop into krew index
- No renaming needed - matches krew convention exactly
- Clean workflow: template → envsubst → oadp.yaml
🐛 Fixes checksum validation errors:
- Only create archives for the 6 krew platforms (not ppc64le/s390x)
- Fix Windows naming: .exe binary → .tar.gz archive (no .exe in archive name)
- Skip non-binary files (kubectl-oadp-design.md)
- Explicit platform list ensures exact match with oadp.yaml
- Better error handling if binaries missing

✅ Now checksums.txt will have exactly the files the workflow expects
🐛 Resolves tar exit code 2 failures across all workflows:
- Disable Go cache in cross-arch build job (cache: false)
- Disable Go cache in all test jobs (Linux/macOS/Windows)
- Add cache cleaning step for build job
- Prevents tar conflicts during cache restoration

✅ No more 'Failed to restore' warnings in CI logs
🚀 More reliable builds across all architectures
Comment thread .github/workflows/release.yml Outdated
🚀 Expand platform coverage for enterprise environments:
- Add linux-ppc64le platform to krew manifest
- Add linux-s390x platform to krew manifest
- Update release workflow to build and package new architectures
- Add environment variable extraction for new platform checksums
- Update release notes to reflect 8 total platforms

✅ Now supports:
- Linux: amd64, arm64, ppc64le, s390x
- macOS: amd64, arm64
- Windows: amd64, arm64

🎯 Enables OADP CLI installation on IBM Power and mainframe systems
@Joeavaikath Joeavaikath requested a review from kaovilai July 18, 2025 13:07
@Joeavaikath Joeavaikath self-assigned this Jul 18, 2025
This was linked to issues Jul 18, 2025
@Joeavaikath Joeavaikath removed a link to an issue Jul 18, 2025
@Joeavaikath Joeavaikath merged commit 2e8da2c into migtools:main Jul 18, 2025
10 checks passed
@Joeavaikath Joeavaikath deleted the release-flow branch February 19, 2026 15:11
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.

Create release.yaml for release artifacts

2 participants