- 
                Notifications
    You must be signed in to change notification settings 
- Fork 715
Embed dotnet-install scripts as resources in Aspire CLI #12296
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
Conversation
| @copilot create a github action that downloads these scripts from: https://dot.net/v1/dotnet-install.sh and sends a pull request to update these files. See https://github.com/dotnet/aspire/blob/main/.github/workflows/update-github-models.yml for inspiration (though it should be simpler) | 
| 
 Created the workflow in commit fc4d219. It runs weekly on Mondays at 06:00 UTC and can also be triggered manually via workflow_dispatch. The workflow downloads both scripts from https://dot.net/v1/ and creates/updates a PR with the updated files. | 
| @copilot run the workflow daily not weekly. | 
| 🚀 Dogfood this PR with: 
 curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 12296Or 
 iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 12296" | 
    
      
        1 similar comment
      
    
  
    | 🚀 Dogfood this PR with: 
 curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 12296Or 
 iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 12296" | 
| @copilot quarantine GetAppHostsCommand_WithMultipleProjects_ReturnsSuccessWithAllCandidates | 
| 
 I need an issue URL to quarantine this test. Could you provide the GitHub issue URL for tracking this flaky test? | 
- Add dotnet-install.sh and dotnet-install.ps1 as embedded resources - Update DotNetSdkInstaller to extract scripts from embedded resources instead of downloading - Remove HttpClient download logic - Add test to verify embedded scripts are accessible Co-authored-by: mitchdenny <[email protected]>
Co-authored-by: davidfowl <[email protected]>
Co-authored-by: davidfowl <[email protected]>
d7a1eb3    to
    5b09642      
    Compare
  
    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.
Pull Request Overview
This PR eliminates the runtime network dependency for downloading .NET SDK installation scripts by embedding dotnet-install.sh and dotnet-install.ps1 as resources within the Aspire CLI assembly. The implementation replaces HTTP downloads with manifest resource extraction and adds automated daily updates via GitHub Actions.
Key changes:
- Replaced HttpClient.GetStringAsync()withAssembly.GetManifestResourceStream()for script retrieval
- Added embedded resources to the CLI project for both bash and PowerShell install scripts
- Implemented GitHub Actions workflow to automatically update embedded scripts daily
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description | 
|---|---|
| src/Aspire.Cli/DotNet/DotNetSdkInstaller.cs | Replaced HTTP download logic with embedded resource extraction | 
| src/Aspire.Cli/Aspire.Cli.csproj | Added embedded resource declarations for install scripts | 
| src/Aspire.Cli/Resources/dotnet-install.sh | New embedded bash install script (1,888 lines) | 
| src/Aspire.Cli/Resources/dotnet-install.ps1 | New embedded PowerShell install script (1,574 lines) | 
| tests/Aspire.Cli.Tests/DotNetSdkInstallerTests.cs | Added test verifying embedded scripts are accessible | 
| .github/workflows/update-dotnet-install-scripts.yml | Added automation workflow for daily script updates | 
Co-authored-by: mitchdenny <[email protected]>
* Initial plan * Embed dotnet-install scripts as resources in Aspire CLI - Add dotnet-install.sh and dotnet-install.ps1 as embedded resources - Update DotNetSdkInstaller to extract scripts from embedded resources instead of downloading - Remove HttpClient download logic - Add test to verify embedded scripts are accessible Co-authored-by: mitchdenny <[email protected]> * Add GitHub Action to auto-update dotnet-install scripts Co-authored-by: davidfowl <[email protected]> * Update workflow to run daily instead of weekly Co-authored-by: davidfowl <[email protected]> * Use C# 8 using declaration syntax for cleaner code Co-authored-by: mitchdenny <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: mitchdenny <[email protected]> Co-authored-by: davidfowl <[email protected]>
Plan: Embed dotnet-install scripts as resources in Aspire CLI
Summary
Successfully replaced the web-based download of
dotnet-install.shanddotnet-install.ps1scripts with embedded resources within the Aspire CLI.Changes Made:
src/Aspire.Cli/Resources/Benefits:
Workflow Details:
All tests pass successfully!
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.