chore(ci): optimize release workflow with centralized config, reusabl… #13600
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.
Added centralized configuration: NODE_VERSION and RELEASE_PACKAGES environment variables
Simplified boolean logic: Replaced complex fromJSON array indexing with ternary operators
Created reusable Node.js composite action (nodejs)
Optimized caching strategy: Removed node_modules cache, kept only Yarn cache to prevent cache thrashing
Fixed job dependencies: stop_agents now only depends on create_release instead of all package jobs
Improved npm publish error handling with proper exit codes
2. Node.js Composite Action (nodejs)
Centralized Node.js, Corepack, and Yarn setup
Configurable Node.js version and frozen lockfile options
Optimized cache strategy using only Yarn cache directory
Cache key: {os}-yarn-{node-version}-{yarn.lock-hash}
Eliminates duplicate setup code across workflows
3. Comprehensive Testing Infrastructure
Created test suites for:
Node.js setup action: Local bash script (test-local.sh) and GitHub Actions workflow (test-action.yml)
Release actions: Comprehensive test script (test-release-actions.sh) and workflow (test-release-actions-workflow.yml)
Helper functions: Test script for all 8 helper functions (test-helpers.sh) including Jest unit tests
4. Documentation (TESTING.md)
Consolidated all testing documentation into single comprehensive guide (617 lines)
Covers local testing, act usage, troubleshooting, and best practices
Documents all helper functions, release scenarios, and safety features
Removed redundant documentation files