-
Notifications
You must be signed in to change notification settings - Fork 0
fix(ci): update squad-release.yml to use GitVersion #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,150 @@ | ||
| # Decision — GitVersion Integration for Squad Release Workflow | ||
|
|
||
| **Date:** 2026-02-20 | ||
| **Author:** Elrond (GitHub Ops) | ||
| **Status:** Implemented | ||
|
|
||
| --- | ||
|
|
||
| ## Problem | ||
|
|
||
| The `squad-release.yml` workflow was configured to extract version from `package.json` (Node.js/JavaScript pattern), but the IssueManager project is a .NET 10.0 application using **GitVersion** for semantic versioning. | ||
|
|
||
| **Impact:** | ||
| - Release automation was non-functional for .NET project | ||
| - Version source mismatch between CI (GitVersion in `squad-ci.yml`) and Release (package.json in `squad-release.yml`) | ||
| - Releases could not be created with correct semantic versioning | ||
|
|
||
| --- | ||
|
|
||
| ## Solution | ||
|
|
||
| Updated `squad-release.yml` to: | ||
|
|
||
| 1. **Replace Node.js setup** with .NET setup | ||
| - Removed `actions/setup-node@v6` | ||
| - Added `actions/setup-dotnet@v5` with `global-json-file: Global.json` | ||
|
|
||
| 2. **Integrate GitVersion** following the same pattern as `squad-ci.yml` | ||
| - Added `gittools/actions/gitversion/setup@v4` (version 6.3.0) | ||
| - Added `gittools/actions/gitversion/execute@v4` with outputs capture | ||
|
|
||
| 3. **Source version from GitVersion outputs** | ||
| - Extract `majorMinorPatch` → `version` output | ||
| - Extract `majorMinorPatch` → `tag` output (prefixed with `v`) | ||
| - Capture `fullSemVer` for release notes | ||
|
|
||
| 4. **Removed Node.js test step** | ||
| - Release workflow no longer runs Node.js tests | ||
| - .NET tests are run in `squad-ci.yml` (single responsibility) | ||
|
|
||
| --- | ||
|
|
||
| ## Implementation | ||
|
|
||
| **File Changed:** `.github/workflows/squad-release.yml` | ||
|
|
||
| **Key Changes:** | ||
| ```yaml | ||
| # Before (incorrect) | ||
| - uses: actions/setup-node@v6 | ||
| with: | ||
| node-version: 22 | ||
| - name: Run tests | ||
| run: node --test test/*.test.js | ||
| - name: Read version from package.json | ||
| id: version | ||
| run: | | ||
| VERSION=$(node -e "console.log(require('./package.json').version)") | ||
|
|
||
| # After (correct) | ||
| - name: Setup .NET | ||
| uses: actions/setup-dotnet@v5 | ||
| with: | ||
| global-json-file: Global.json | ||
| - name: Install GitVersion | ||
| uses: gittools/actions/gitversion/setup@v4 | ||
| with: | ||
| versionSpec: "6.3.0" | ||
| - name: Use GitVersion | ||
| id: gitversion | ||
| uses: gittools/actions/gitversion/execute@v4 | ||
| - name: Extract version from GitVersion | ||
| id: version | ||
| run: | | ||
| echo "version=${{ steps.gitversion.outputs.majorMinorPatch }}" >> "$GITHUB_OUTPUT" | ||
| echo "tag=v${{ steps.gitversion.outputs.majorMinorPatch }}" >> "$GITHUB_OUTPUT" | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## Behavior | ||
|
|
||
| **Before Fix:** | ||
| - Workflow would fail on Node.js setup (no `package.json` in expected format) | ||
| - No releases could be created | ||
|
|
||
| **After Fix:** | ||
| - Workflow establishes .NET environment via `global.json` | ||
| - GitVersion calculates semantic version from git history (tags, commits) | ||
| - Release is tagged and created using semantic version from GitVersion | ||
| - Tag deduplication logic remains intact (checks if tag exists before creating) | ||
| - Release notes auto-generated by GitHub | ||
|
|
||
| --- | ||
|
|
||
| ## Scope | ||
|
|
||
| - **Affects:** `squad-release.yml` workflow only | ||
| - **Does NOT affect:** `squad-ci.yml`, release creation logic, tag handling | ||
| - **Backward Compatibility:** N/A (workflow was non-functional with .NET project) | ||
|
|
||
| --- | ||
|
|
||
| ## Testing Assumptions | ||
|
|
||
| 1. ✅ Workflow triggers on push to `main` branch | ||
| 2. ✅ GitVersion correctly calculates semantic version from git history | ||
| 3. ✅ Tag is created and pushed correctly | ||
| 4. ✅ GitHub release is created with auto-generated notes | ||
| 5. ✅ Tag deduplication prevents duplicate releases | ||
| 6. ✅ Version extraction outputs are used by downstream release steps | ||
|
|
||
| --- | ||
|
|
||
| ## Architecture Decision | ||
|
|
||
| **The release workflow now sources truth from GitVersion, aligning with the CI/CD pipeline's version calculation.** This ensures: | ||
|
|
||
| - **Single source of truth:** Version comes from git history (tags + commits), not external files | ||
| - **Consistency:** Both `squad-ci.yml` and `squad-release.yml` use GitVersion | ||
| - **Automation:** Release versioning is fully automated, no manual version bumping | ||
| - **Semantic Versioning:** GitVersion enforces SemVer 2.0.0 compliance | ||
|
|
||
| --- | ||
|
|
||
| ## Related Decisions | ||
|
|
||
| - **2026-02-17:** Team decided on vertical slice architecture with CQRS — requires semantic versioning for releases | ||
| - **2026-02-19:** GitHub configuration audit established automated release workflow patterns | ||
|
|
||
| --- | ||
|
|
||
| ## Checkpoints | ||
|
|
||
| - [x] Removed Node.js setup from squad-release.yml | ||
| - [x] Added .NET + GitVersion setup matching squad-ci.yml pattern | ||
| - [x] Updated version extraction to use GitVersion outputs | ||
| - [x] Removed package.json-based version reading | ||
| - [x] Verified tag creation and release logic remain intact | ||
| - [x] Documented architectural decision | ||
|
|
||
| --- | ||
|
|
||
| **Next Steps (for team):** | ||
|
|
||
| 1. Test the updated workflow on next main branch push (or trigger manually via `workflow_dispatch`) | ||
| 2. Verify release is created with correct semantic version | ||
| 3. Validate release notes are generated correctly | ||
| 4. If needed, adjust version extraction to use `fullSemVer` instead of `majorMinorPatch` based on team versioning preference | ||
|
|
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The workflow references 'Global.json' but the actual file in the repository is named 'global.json' (lowercase). While this may work on case-insensitive filesystems (like macOS/Windows), it will fail on case-sensitive filesystems used by GitHub Actions runners (Linux). The reference should be changed to 'global.json' to match the exact filename.