Skip to content

Commit 2fcc224

Browse files
committed
Refactor GitHub Actions workflow for Copilot setup by simplifying .NET 9 SDK installation steps and removing unnecessary checks and steps.
1 parent af92b03 commit 2fcc224

File tree

1 file changed

+29
-69
lines changed

1 file changed

+29
-69
lines changed
Lines changed: 29 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,30 @@
1-
# GitHub Copilot Setup Steps for NLWebNet
2-
# This file defines the setup steps needed to work with the NLWebNet repository
3-
4-
name: Setup .NET 9 Environment for NLWebNet
5-
description: Install .NET 9 SDK and restore dependencies for the NLWebNet library and demo application
6-
7-
steps:
8-
- name: Install .NET 9 SDK
9-
description: Download and install the .NET 9 SDK for Ubuntu using the official Microsoft install script
10-
run: |
11-
# Check if .NET 9 is already installed
12-
if command -v dotnet &> /dev/null && dotnet --list-sdks | grep -q "9\."; then
13-
echo "✅ .NET 9 SDK is already installed"
14-
dotnet --version
15-
# Still need to install Aspire workload if not present
16-
if ! dotnet workload list | grep -q "aspire"; then
17-
echo "📦 Installing Aspire workload..."
1+
name: "Copilot Setup Steps"
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
paths:
7+
- .github/workflows/copilot-setup-steps.yml
8+
pull_request:
9+
paths:
10+
- .github/workflows/copilot-setup-steps.yml
11+
12+
jobs:
13+
# This job MUST be named exactly `copilot-setup-steps`
14+
copilot-setup-steps:
15+
runs-on: ubuntu-latest
16+
permissions:
17+
contents: read
18+
19+
steps:
20+
- name: Install .NET 9 SDK
21+
shell: bash
22+
run: |
23+
curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --channel 9.0
24+
echo "PATH=$HOME/.dotnet:$PATH" >> $GITHUB_ENV
25+
26+
- name: Install .NET Aspire workload
27+
shell: bash
28+
run: |
29+
export PATH="$HOME/.dotnet:$PATH"
1830
dotnet workload install aspire
19-
fi
20-
exit 0
21-
fi
22-
23-
# Download and install .NET 9 SDK using official Microsoft install script
24-
echo "📦 Installing .NET 9 SDK..."
25-
curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --channel 9.0 --install-dir ~/.dotnet
26-
27-
# Add .NET to PATH if not already present
28-
if [[ ":$PATH:" != *":$HOME/.dotnet:"* ]]; then
29-
echo 'export PATH="$HOME/.dotnet:$PATH"' >> ~/.bashrc
30-
export PATH="$HOME/.dotnet:$PATH"
31-
fi
32-
33-
# Set environment variables for subsequent steps (GitHub Actions specific)
34-
echo "DOTNET_ROOT=$HOME/.dotnet" >> $GITHUB_ENV
35-
echo "$HOME/.dotnet" >> $GITHUB_PATH
36-
echo "$HOME/.dotnet/tools" >> $GITHUB_PATH
37-
38-
# Verify installation
39-
echo "🔍 Verifying .NET installation..."
40-
dotnet --version
41-
dotnet --info
42-
43-
# Install required workloads including Aspire
44-
echo "📦 Installing required workloads..."
45-
dotnet workload install aspire
46-
47-
- name: Restore NuGet packages
48-
description: Restore all NuGet package dependencies for the solution
49-
run: |
50-
dotnet restore
51-
52-
- name: Build solution
53-
description: Build the entire solution to verify setup is working
54-
run: |
55-
dotnet build --configuration Debug --no-restore
56-
57-
- name: Verify setup
58-
description: Run a quick verification that everything is set up correctly
59-
run: |
60-
echo "✅ .NET 9 SDK installed successfully"
61-
echo "✅ Required workloads (including Aspire) installed"
62-
echo "✅ NuGet packages restored"
63-
echo "✅ Solution builds successfully"
64-
echo ""
65-
echo "🚀 You can now work with the NLWebNet repository!"
66-
echo ""
67-
echo "Quick start commands:"
68-
echo " - Build: dotnet build"
69-
echo " - Test: dotnet test"
70-
echo " - Run demo: dotnet run --project demo"

0 commit comments

Comments
 (0)