finos / finos/morphir-dotnet

Phase 4: Deployment & Distribution

Open
#212 0 comments 1 reaction 2 assignees Assigned to @DamianReeves View on GitHub
enhancement phase-4
Dominant language
F#
Stars
14
Forks
12
PR merge metrics
No merged PRs in 30d

Description

## Phase 4: Deployment & Distribution

**Part of Epic**: #208
**Timeline**: 2-3 days
**Priority**: High (enables releases)
**Depends On**: #209, #210, #211

## Overview

Update GitHub Actions workflows for dual distribution, implement GitHub release automation with executables, and validate the complete deployment pipeline.

## Tasks

### 4.1 Update Deployment Workflow
- [ ] Update `.github/workflows/deployment.yml`:
- Trigger on tag push: `v*`
- Add validate-version job
- Extract version from CHANGELOG.md (not env var)
- Validate version exists in CHANGELOG.md
- Pass version to all jobs
- [ ] Update release job:
- Run TestAll (includes TestBuild)
- Use version from CHANGELOG.md
- Publish to NuGet with PublishAll target
- [ ] Test workflow locally with act (if possible)

### 4.2 GitHub Release Automation
- [ ] Add create-github-release job to workflow
- [ ] Download all executable artifacts
- [ ] Extract release notes from CHANGELOG.md
- [ ] Create GitHub release with:
- Tag: v{version}
- Name: Release v{version}
- Body: Release notes from CHANGELOG.md
- Attachments: All platform executables
- [ ] Use softprops/action-gh-release@v1

### 4.3 Update Install Scripts
- [ ] Verify install-linux.sh uses "morphir" command
- [ ] Verify install-macos.sh uses "morphir" command
- [ ] Verify install-windows.ps1 uses "morphir" command
- [ ] Update download URLs to GitHub releases API
- [ ] Test scripts manually on each platform

### 4.4 Validate PublishTool Target
- [ ] Update glob pattern in Build.Publishing.cs
- [ ] Search for `Morphir.Tool.*.nupkg` (not Morphir.*.nupkg)
- [ ] Verify error message if package not found
- [ ] Test locally with PublishLocalTool

## BDD Acceptance Tests

```gherkin
Feature: Deployment workflow
Scenario: Deploy on tag push
Given tag v0.2.1 is pushed
When deployment workflow runs
Then version 0.2.1 should be extracted from CHANGELOG.md
And build tests should run and pass
And packages should be published to NuGet
And GitHub release v0.2.1 should be created
And executables should be attached to release

Scenario: Block deployment if version not in CHANGELOG
Given tag v0.2.2 is pushed
But CHANGELOG.md doesn't have [0.2.2]
When deployment workflow runs
Then validate-version job should fail
And no packages should be published
And no GitHub release should be created

Scenario: Executables available in GitHub release
Given successful deployment to v0.2.1
When I view GitHub release v0.2.1
Then morphir-linux-x64 should be attached
And morphir-linux-arm64 should be attached
And morphir-win-x64 should be attached
And morphir-osx-arm64 should be attached
And release notes should match CHANGELOG.md

Scenario: Install script downloads from GitHub
Given GitHub release v0.2.1 exists
When user runs install script
Then script should download morphir-{platform} from release
And executable should be placed in /usr/local/bin (or equivalent)
And morphir command should be in PATH
```

## Verification Checklist

### Pre-Deployment Testing
- [ ] Create test tag locally: `git tag -a v0.0.0-test -m "Test"`
- [ ] Push test tag to fork (don't push to main repo!)
- [ ] Verify workflow triggers correctly
- [ ] Verify version extraction works
- [ ] Verify build tests run
- [ ] Delete test tag after verification

### Deployment Testing
- [ ] First real deployment after PR merge
- [ ] Monitor workflow execution
- [ ] Verify packages published to NuGet.org
- [ ] Verify GitHub release created
- [ ] Verify executables attached to release
- [ ] Test tool installation: `dotnet tool install -g Morphir.Tool`
- [ ] Test executable download from release

### Install Script Testing
- [ ] Test install-linux.sh on Ubuntu
- [ ] Test install-macos.sh on macOS
- [ ] Test install-windows.ps1 on Windows
- [ ] Verify correct version downloaded
- [ ] Verify command available in PATH

## Definition of Done

- All tasks completed
- All BDD scenarios verified (manual testing)
- Deployment workflow working end-to-end
- GitHub releases automated
- Install scripts validated
- First successful release completed
- PR ready for review

## Dependencies

**Depends On**:
- #209 (Phase 1 - Morphir.Tool project)
- #210 (Phase 2 - Version extraction)
- #211 (Phase 3 - Build tests)

**Blocks**:
- Future releases

## Deployment Workflow Diagram

```
Tag Push (v0.2.1)

Validate Version
├─ Extract version from tag
├─ Check CHANGELOG.md has [0.2.1]
└─ Pass version to jobs

Build Executables (parallel)
├─ linux-x64
├─ linux-arm64
├─ win-x64
└─ osx-arm64

Release Job
├─ Build packages
├─ Run TestAll (includes TestBuild)
├─ Publish to NuGet.org
└─ Wait for completion

Create GitHub Release
├─ Download executables
├─ Extract release notes
├─ Create release v0.2.1
└─ Attach executables
```

## Notes

- Use branch protection - can't push directly to main
- Tag push happens after PR merge
- First test on fork before main repo
- Monitor deployment closely on first run
- Have rollback plan ready
- Document any issues encountered

## Rollback Plan

If deployment fails:
1. Delete tag: `git push --delete origin v{version}`
2. Delete GitHub release (if created)
3. Unlist packages from NuGet (if published)
4. Fix issue
5. Create new tag with patch version

## Related Documentation

- **Epic**: #208
- **PRD**: [Phase 4](https://github.com/finos/morphir-dotnet/blob/feature/deployment-architecture-refactor/docs/content/contributing/design/prds/deployment-architecture-refactor.md#phase-4-deployment--distribution-2-3-days)
- **GitHub Actions**: https://docs.github.com/en/actions
- **softprops/action-gh-release**: https://github.com/softprops/action-gh-release

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.