Improve release script#565
Merged
Chemaclass merged 3 commits intomainfrom Dec 15, 2025
Merged
Conversation
- Add --sandbox flag to test releases in isolated temp directory - Add --force flag to skip confirmations (for CI automation) - Add --json flag for machine-readable output - Add --verbose flag for detailed logging - Add --rollback flag to restore from backup - Add pre-flight checks (gh auth, git clean, required files, etc.) - Add automatic backup/rollback on failure - Add proper exit codes (0=success, 1=validation, 2=execution) - Redirect all logs to stderr, only JSON to stdout - Add tests for new functionality
- Replace 'which' with 'command -v' for POSIX compliance - Simplify preflight::check_all using array iteration - Simplify backup::save_all using array iteration
7344494 to
eafad66
Compare
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.
📚 Description
Improves the release script with sandbox mode, pre-flight checks, automatic rollback capabilities, and code quality refactoring for safer, more testable, and automated releases.
🔖 Changes
New Features
--sandbox): Test releases in an isolated temp directory with mocked git/gh commands--force): Skip all interactive confirmations for CI automation--json): Machine-readable output for CI pipelines (logs go to stderr, JSON to stdout)--verbose): Detailed logging for debugging--rollback): Restore files from the most recent backupSafety & Resilience
Code Quality Refactoring
release::update_file_patternhelper to consolidate version update functionsRELEASE_FILESconstant to avoid repeating file listsrelease::blank_linehelper for consistent output formattingGITHUB_REPO_PATHandGITHUB_REPO_URLfor maintainability$EXIT_VALIDATION_ERRORinstead of hardcoded1📖 Usage Examples
Preview a release (dry-run)
Test release in sandbox (safe, isolated environment)
This creates a temp directory, copies the project, mocks git push and gh commands, and shows what would happen.
CI/CD automation
Output:
{ "status": "success", "version": "0.31.0", "current_version": "0.30.0", "sandbox_mode": false, "dry_run": false, "force_mode": true, "completed_steps": ["update_bashunit_version","update_install_version",...], "timestamp": "2025-12-15T10:30:00Z" }Rollback after a failed release
Full interactive release with GitHub release creation
✅ To-do list
CHANGELOG.mdto reflect the new feature or fix