Skip to content

Commit f729be7

Browse files
author
Prathik Rao
committed
baiju
1 parent aa32b53 commit f729be7

File tree

2 files changed

+13
-21
lines changed

2 files changed

+13
-21
lines changed

.github/workflows/build-cs-steps.yml

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ on:
1010
required: false
1111
type: boolean
1212
default: false
13-
useNightly:
14-
required: false
15-
type: boolean
16-
default: true
1713
buildConfiguration:
1814
required: false
1915
type: string
@@ -34,22 +30,12 @@ jobs:
3430
with:
3531
clean: true
3632

37-
# adapted from https://github.com/actions/setup-dotnet?tab=readme-ov-file#azure-artifacts
38-
# saves auth credentials to ../nuget.config
3933
- name: Setup .NET 9 SDK
4034
uses: actions/setup-dotnet@v5
4135
with:
4236
dotnet-version: '9.0.x'
43-
source-url: https://pkgs.dev.azure.com/microsoft/windows.ai.toolkit/_packaging/Neutron/nuget/v3/index.json
44-
env:
45-
NUGET_AUTH_TOKEN: ${{ secrets.AZURE_DEVOPS_PAT }}
46-
47-
- name: Add ORT Feed (Nightly)
48-
if: ${{ inputs.useNightly }}
49-
run: dotnet nuget add source "https://pkgs.dev.azure.com/aiinfra/PublicPackages/_packaging/ORT/nuget/v3/index.json" -n ORT --configfile ../nuget.config
5037

51-
- name: Resolve Nightly Version
52-
if: ${{ inputs.useNightly }}
38+
- name: Resolve Latest Core Version
5339
shell: pwsh
5440
run: |
5541
$UseWinML = "${{ inputs.useWinML }}"
@@ -81,11 +67,11 @@ jobs:
8167
8268
- name: Restore dependencies
8369
run: |
84-
dotnet restore sdk_v2\cs\src\Microsoft.AI.Foundry.Local.csproj /p:UseWinML=${{ inputs.useWinML }} /p:FoundryLocalCoreVersion=${{ env.FOUNDRY_CORE_VERSION }} --configfile ../nuget.config
70+
dotnet restore sdk_v2\cs\src\Microsoft.AI.Foundry.Local.csproj /p:UseWinML=${{ inputs.useWinML }} /p:FoundryLocalCoreVersion=${{ env.FOUNDRY_CORE_VERSION }} --configfile sdk_v2\cs\NuGet.config
8571
8672
- name: Build solution
8773
run: |
88-
dotnet build sdk_v2\cs\src\Microsoft.AI.Foundry.Local.csproj --configfile ../nuget.config --no-restore --configuration ${{ inputs.buildConfiguration }} /p:UseWinML=${{ inputs.useWinML }} /p:FoundryLocalCoreVersion=${{ env.FOUNDRY_CORE_VERSION }}
74+
dotnet build sdk_v2\cs\src\Microsoft.AI.Foundry.Local.csproj --no-restore --configuration ${{ inputs.buildConfiguration }} /p:UseWinML=${{ inputs.useWinML }} /p:FoundryLocalCoreVersion=${{ env.FOUNDRY_CORE_VERSION }}
8975
9076
# need to use direct git commands to clone from Azure DevOps instead of actions/checkout
9177
- name: Checkout test-data-shared from Azure DevOps
@@ -131,11 +117,9 @@ jobs:
131117
$useWinML = "${{ inputs.useWinML }}"
132118
$coreVersion = "${{ env.FOUNDRY_CORE_VERSION }}"
133119
134-
# If we are using a nightly core version (which is a prerelease),
135-
# we must ensure our package version is also marked as prerelease to avoid NU5104.
136-
if (-not [string]::IsNullOrWhiteSpace($coreVersion) -and -not $version.Contains("dev")) {
120+
# Always mark as prerelease since we use nightly core
121+
if (-not $version.Contains("dev")) {
137122
$version = "$version-dev"
138-
Write-Host "Updating package version to $version to match prerelease dependency."
139123
}
140124
141125
Write-Host "Packing project: $projectPath"

sdk_v2/cs/NuGet.config

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<packageSources>
4+
<clear />
5+
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
6+
<add key="ORT" value="https://pkgs.dev.azure.com/aiinfra/PublicPackages/_packaging/ORT/nuget/v3/index.json" />
7+
</packageSources>
8+
</configuration>

0 commit comments

Comments
 (0)