Add workflow to release all components with changes automatically#12
Add workflow to release all components with changes automatically#12
Conversation
Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>
Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>
…in permissions Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Codecov ReportAll modified and coverable lines are covered by tests ✅ 📢 Thoughts on this report? Let us know! |
|
@copilot Rather than duplicating the workflows from the individual release files into the release-all file, wouldn't it make sense to just have logic to detect if a change was introduced, and if so, trigger the relevant release workflow file? Also, the change detection should ignore things that don't impact the logic of a go module, such as tests, documentation, github workflow files, etc. |
…hange detection Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>
I've addressed both of your suggestions in commit 43c5db6:
This makes the workflow more maintainable and ensures releases are only triggered for meaningful changes. |
There was a problem hiding this comment.
Pull Request Overview
Adds an end-to-end workflow (release-all.yml) to automatically detect and release the main library and any modules with changes, and exposes workflow_call inputs in existing workflows for reusability.
- Exposes
release.ymlandmodule-release.ymlviaworkflow_callto accept parameters from other workflows. - Introduces
release-all.ymlthat scans for relevant changes in the main library and each module, then conditionally invokes the two release workflows. - Consolidates reporting into a final summary job showing which components were released or skipped.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| .github/workflows/release.yml | Added workflow_call section to accept version and releaseType inputs for reuse by other workflows. |
| .github/workflows/module-release.yml | Added workflow_call section to accept module, version, and releaseType inputs. |
| .github/workflows/release-all.yml | New workflow to detect changes in main library & modules and to call the above workflows accordingly. |
Comments suppressed due to low confidence (2)
.github/workflows/release-all.yml:52
- The variables INCLUDE_PATTERNS and EXCLUDE_PATTERNS are defined but never used. Consider removing them or integrating them into the filtering logic to avoid confusion and reduce dead code.
INCLUDE_PATTERNS="*.go go.mod go.sum"
.github/workflows/release-all.yml:235
- Using single quotes around the GitHub expression may prevent the JSON array from expanding correctly in the shell. Use double quotes (e.g.,
MODULES_WITH_CHANGES="${{ needs.detect-changes.outputs.modules_with_changes }}") so the variable is set to the actual output value.
MODULES_WITH_CHANGES='${{ needs.detect-changes.outputs.modules_with_changes }}'
This PR adds a new GitHub workflow that automatically detects and releases all components (main library + modules) that have changes since their last release.
Problem
Previously, releases required manual intervention:
release.ymlworkflow (manual trigger)module-release.ymlworkflow (manual trigger per module)Solution
Added
.github/workflows/release-all.ymlthat provides:🎯 Automatic Change Detection
modules/directory since lastv*tagmodules/{module}/v*tag🏷️ Preserves Existing Tag Formats
v{version}(e.g.,v1.0.0)modules/{module}/v{version}(e.g.,modules/cache/v1.0.0)🚀 Single Workflow Operation
📊 Comprehensive Reporting
The workflow provides clear output showing:
Example Output
Implementation Details
release.ymlandmodule-release.ymlTesting
This enables the requested functionality: "trigger a release that releases a new version of Modular (if changes exist since the last release), as well as detection for each module to determine if it has changes, and then a triggered release for each module having changes since its own last release."
Fixes #11.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.