Skip to content

Add workflow to release all components with changes automatically#12

Merged
intel352 merged 6 commits intomainfrom
copilot/fix-11
Jun 27, 2025
Merged

Add workflow to release all components with changes automatically#12
intel352 merged 6 commits intomainfrom
copilot/fix-11

Conversation

Copy link
Contributor

Copilot AI commented Jun 27, 2025

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:

  • Main library releases via release.yml workflow (manual trigger)
  • Individual module releases via module-release.yml workflow (manual trigger per module)
  • No way to release everything that has changes in a single operation

Solution

Added .github/workflows/release-all.yml that provides:

🎯 Automatic Change Detection

  • Main Library: Detects changes excluding modules/ directory since last v* tag
  • Individual Modules: Scans each module for changes since its last modules/{module}/v* tag
  • Smart Releases: Only creates releases for components that actually have changes

🏷️ Preserves Existing Tag Formats

  • Main library: v{version} (e.g., v1.0.0)
  • Modules: modules/{module}/v{version} (e.g., modules/cache/v1.0.0)

🚀 Single Workflow Operation

# Triggers via GitHub Actions UI
# Choose release type: patch/minor/major
# Automatically releases everything with changes

📊 Comprehensive Reporting

The workflow provides clear output showing:

  • What was checked for changes
  • What releases were created
  • Final summary of all released components

Example Output

🎉 RELEASE SUMMARY
==================
✅ Main library released: v1.2.1
✅ Modules released:
   - cache:v1.0.3
   - database:v2.1.0
   - httpserver:v1.1.2

Implementation Details

  • Reuses existing release logic from release.yml and module-release.yml
  • Maintains compatibility with existing workflows
  • Includes comprehensive error handling and logging
  • Announces releases to Go proxy for discoverability

Testing

  • Created dry-run simulation showing correct change detection
  • Verified YAML syntax and workflow structure
  • Confirmed all existing tests continue to pass

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.

Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>
Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>
Copilot AI changed the title [WIP] Workflow to release everything that has changes Add workflow to release all components with changes automatically Jun 27, 2025
Copilot AI requested a review from intel352 June 27, 2025 18:09
…in permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@codecov
Copy link

codecov bot commented Jun 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

@intel352
Copy link
Contributor

@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>
Copy link
Contributor Author

Copilot AI commented Jun 27, 2025

@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, t...

I've addressed both of your suggestions in commit 43c5db6:

  1. Eliminated code duplication: The release-all.yml workflow now uses workflow_call to trigger the existing release.yml and module-release.yml workflows instead of duplicating their logic.

  2. Improved change detection: The workflow now only considers files that impact Go module logic:

    • ✅ Includes: .go files (excluding tests), go.mod, go.sum
    • ❌ Excludes: *_test.go, *.md, .github/*, examples/*

This makes the workflow more maintainable and ensures releases are only triggered for meaningful changes.

@intel352 intel352 requested a review from Copilot June 27, 2025 21:57
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.yml and module-release.yml via workflow_call to accept parameters from other workflows.
  • Introduces release-all.yml that 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 }}'

@intel352 intel352 marked this pull request as ready for review June 27, 2025 22:19
@intel352 intel352 merged commit 8945fcf into main Jun 27, 2025
3 checks passed
@intel352 intel352 deleted the copilot/fix-11 branch June 27, 2025 22:19
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.

Workflow to release everything that has changes

3 participants