Skip to content

Commit fd96b46

Browse files
committed
Add laf as ADO secret
1 parent 9421efe commit fd96b46

5 files changed

Lines changed: 24 additions & 5 deletions

File tree

.pipelines/v2/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ extends:
102102
useManagedIdentity: $(SigningUseManagedIdentity)
103103
clientId: $(SigningOriginalClientId)
104104
# Have msbuild use the release nuget config profile
105-
additionalBuildOptions: /p:RestoreConfigFile="$(Build.SourcesDirectory)\.pipelines\release-nuget.config" /p:EnableCmdPalAOT=true
105+
additionalBuildOptions: /p:RestoreConfigFile="$(Build.SourcesDirectory)\.pipelines\release-nuget.config" /p:EnableCmdPalAOT=true /p:PhiSilicaLafToken=$(PhiSilicaLafToken) /p:PhiSilicaLafAttestation="$(PhiSilicaLafAttestation)"
106106
beforeBuildSteps:
107107
# Sets versions for all PowerToy created DLLs
108108
- pwsh: |-

Directory.Build.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<RepoRoot>$(MSBuildThisFileDirectory)</RepoRoot>
44
</PropertyGroup>
55
<Import Project="$(RepoRoot)src\Version.props" />
6+
<Import Project="$(RepoRoot)src\PhiSilicaLaf.props" />
67
<PropertyGroup>
78
<Copyright>Copyright (C) Microsoft Corporation. All rights reserved.</Copyright>
89
<AssemblyCopyright>Copyright (C) Microsoft Corporation. All rights reserved.</AssemblyCopyright>

src/PhiSilicaLaf.props

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<!-- Phi Silica Limited Access Feature credentials.
5+
Local dev defaults below; overridden by /p: in release pipelines. -->
6+
<PhiSilicaLafToken Condition="'$(PhiSilicaLafToken)'==''">RmToMMYJHZkQSrKP5lWesA==</PhiSilicaLafToken>
7+
<PhiSilicaLafAttestation Condition="'$(PhiSilicaLafAttestation)'==''">djwsxzxb4ksa8 has registered their use of com.microsoft.windows.ai.languagemodel with Microsoft and agrees to the terms of use.</PhiSilicaLafAttestation>
8+
</PropertyGroup>
9+
</Project>

src/settings-ui/Settings.UI.Library/PhiSilicaLafHelper.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ namespace Microsoft.PowerToys.Settings.UI.Library;
1111
public static class PhiSilicaLafHelper
1212
{
1313
private const string FeatureId = "com.microsoft.windows.ai.languagemodel";
14-
private const string Token = "RmToMMYJHZkQSrKP5lWesA==";
15-
private const string Attestation = "djwsxzxb4ksa8 has registered their use of com.microsoft.windows.ai.languagemodel with Microsoft and agrees to the terms of use.";
1614

1715
private static readonly object _lock = new();
1816
private static bool _attempted;
@@ -38,8 +36,8 @@ public static bool TryUnlock()
3836
{
3937
var access = LimitedAccessFeatures.TryUnlockFeature(
4038
FeatureId,
41-
Token,
42-
Attestation);
39+
PhiSilicaLafCredentials.Token,
40+
PhiSilicaLafCredentials.Attestation);
4341

4442
_unlocked = access.Status == LimitedAccessFeatureStatus.Available
4543
|| access.Status == LimitedAccessFeatureStatus.AvailableWithoutToken;

src/settings-ui/Settings.UI.Library/Settings.UI.Library.csproj

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,15 @@
4242
</EmbeddedResource>
4343
</ItemGroup>
4444

45+
<!-- Generate PhiSilicaLafCredentials.g.cs from MSBuild properties (overridable via /p: in release pipelines) -->
46+
<Target Name="GeneratePhiSilicaLafCredentials" BeforeTargets="BeforeCompile;CoreCompile" Inputs="$(MSBuildProjectFile)" Outputs="$(IntermediateOutputPath)PhiSilicaLafCredentials.g.cs">
47+
<PropertyGroup>
48+
<PhiSilicaLafCredentialsPath>$(IntermediateOutputPath)PhiSilicaLafCredentials.g.cs</PhiSilicaLafCredentialsPath>
49+
</PropertyGroup>
50+
<WriteLinesToFile File="$(PhiSilicaLafCredentialsPath)" Overwrite="true" Lines="// &lt;auto-generated/&gt;&#10;namespace Microsoft.PowerToys.Settings.UI.Library%3B&#10;&#10;internal static class PhiSilicaLafCredentials&#10;{&#10; internal const string Token = &quot;$(PhiSilicaLafToken)&quot;%3B&#10; internal const string Attestation = &quot;$(PhiSilicaLafAttestation)&quot;%3B&#10;}" />
51+
<ItemGroup>
52+
<Compile Include="$(PhiSilicaLafCredentialsPath)" Condition="!@(Compile->AnyHaveMetadataValue('Identity', '$(PhiSilicaLafCredentialsPath)'))" />
53+
</ItemGroup>
54+
</Target>
55+
4556
</Project>

0 commit comments

Comments
 (0)