Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions .github/workflows/copilot-setup-steps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Copilot Setup Steps for Multi-Version .NET

# Trigger the workflow on multiple events for validation and manual execution
on:
# Allow manual triggering from the Actions tab
workflow_dispatch:
# Run on push to validate workflow changes
push:
paths:
- '.github/workflows/copilot-setup-steps.yml'
# Run on pull request to validate workflow changes
pull_request:
paths:
- '.github/workflows/copilot-setup-steps.yml'

# Set minimum required permissions for security best practices
# Only grant read access to repository contents
permissions:
contents: read

jobs:
# Job name must be 'copilot-setup-steps' to be recognized by GitHub Copilot
copilot-setup-steps:
runs-on: ubuntu-latest

steps:
# Checkout with full history for proper git operations
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

# Setup multiple .NET SDK versions in a single step using multi-version syntax
# Using specific version numbers for reproducibility (not wildcards)
# Includes NuGet package caching with lock files for performance optimization
- name: Setup .NET SDKs (6.0, 8.0, 10.0)
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.428
8.0.416
10.0.101
# Enable NuGet package caching for faster builds
cache: true
# Use packages.lock.json files for cache dependency tracking
cache-dependency-path: '**/packages.lock.json'

# Set up .NET environment variables for optimal performance and privacy
- name: Configure .NET environment variables
run: |
echo "DOTNET_ROOT=$HOME/.dotnet" >> $GITHUB_ENV
echo "DOTNET_CLI_TELEMETRY_OPTOUT=1" >> $GITHUB_ENV
echo "DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1" >> $GITHUB_ENV
echo "DOTNET_NOLOGO=1" >> $GITHUB_ENV

# Restore dependencies with locked mode to ensure deterministic package versions
# This requires packages.lock.json files to exist in each project
- name: Restore dependencies with lock files
run: dotnet restore --locked-mode

# Note: dotnet format is built into .NET SDK 6+ and available via 'dotnet format' command
# No separate installation is needed as it's included with the SDKs we've installed above

# Validate that the setup works by building all projects
- name: Build validation
run: dotnet build --no-restore --configuration Release

# Display installed .NET versions for verification
- name: Display .NET versions
run: dotnet --list-sdks
1 change: 1 addition & 0 deletions samples/UniqueIdMaker/UniqueIdMaker.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<!-- Roll forward to future major versions of the netcoreapp as needed -->
<RollForward>Major</RollForward>
<LangVersion>10</LangVersion>
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
</PropertyGroup>

<ItemGroup>
Expand Down
18 changes: 18 additions & 0 deletions samples/UniqueIdMaker/packages.lock.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"version": 1,
"dependencies": {
"net6.0": {
"FSharp.Core": {
"type": "Transitive",
"resolved": "10.0.100",
"contentHash": "vWHaY4Pk7mUv5gJN9+rbods+QnPjhrw3sdGw2R9pFLIBzHkkN26eMgubPHZVoS7xwLA9TZuoHGLrboY5QOBcdA=="
},
"unique": {
"type": "Project",
"dependencies": {
"FSharp.Core": "[10.0.100, )"
}
}
}
}
}
27 changes: 27 additions & 0 deletions src/unique/packages.lock.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"version": 1,
"dependencies": {
".NETStandard,Version=v2.0": {
"FSharp.Core": {
"type": "Direct",
"requested": "[10.0.100, )",
"resolved": "10.0.100",
"contentHash": "vWHaY4Pk7mUv5gJN9+rbods+QnPjhrw3sdGw2R9pFLIBzHkkN26eMgubPHZVoS7xwLA9TZuoHGLrboY5QOBcdA=="
},
"NETStandard.Library": {
"type": "Direct",
"requested": "[2.0.3, )",
"resolved": "2.0.3",
"contentHash": "st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==",
"dependencies": {
"Microsoft.NETCore.Platforms": "1.1.0"
}
},
"Microsoft.NETCore.Platforms": {
"type": "Transitive",
"resolved": "1.1.0",
"contentHash": "kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A=="
}
}
}
}
1 change: 1 addition & 0 deletions src/unique/unique.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageTags>GUID</PackageTags>
<Title>unique</Title>
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
</PropertyGroup>

<ItemGroup>
Expand Down
Loading