Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit f6959d1

Browse files
authored
Merge pull request #482 from github/fixes/client-id
Remove dependency on private script submodule
2 parents bc89d8e + 15b9f44 commit f6959d1

File tree

8 files changed

+33
-52
lines changed

8 files changed

+33
-52
lines changed

.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@
1010
[submodule "submodules/akavache"]
1111
path = submodules/akavache
1212
url = https://github.com/editor-tools/Akavache
13-
[submodule "script"]
14-
path = script
15-
url = [email protected]:github/VisualStudioBuildScripts
1613
[submodule "submodules/octokit.graphql.net"]
1714
path = submodules/octokit.graphql.net
1815
url = https://github.com/octokit/octokit.graphql.net

Key.snk

596 Bytes
Binary file not shown.

azure-pipelines.yml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,8 @@ variables:
1313
buildConfiguration: 'Release'
1414

1515
steps:
16-
- task: InstallSSHKey@0
17-
inputs:
18-
hostName: github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==
19-
sshPublicKey: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCx/AxLjr4mhH7XFlbISb65GBxQnVnKh1owmAT1bK/Qt1b4/Z0SL68IvV88DpgLyKbica2giEVfKo/Z4dkO+P8M2bGXrNgazzfO910DlR+e1vt8BSU/Dbvscz0i1lsfKb3PnfSouCkQev6Th0v+hBdgkuackWgaBw22DDLkp9Uf/cAo+QYLz56p5KVctEESRRgGgIIlZyUc8OYDMSU2wQhG9x31mSyJ4ODuOZsi1RgBBHrgUb2QRhLJ9nZWfQgGBRDxGYTKLWiWIQwgSVQ9x1Az/Rei+CbPRvLcVGg+5vHt8lcu+HxEgrY4IsjXdMqosPqxQ+TT6f+G4GQDn8+IQ4wOpTVi84PkOQX3JPE2QSJwWA0AHNe5NTSns6WWYQyzxFJYBN2pLPuMnj9/+ozV3GaeQqn47WHfUH3s5IawNQPTFDxcl4qsmU66Ybfqa4eFIPEvCCp1leQcuXyDHxKLq80x1szN4kn0oyL2W0zbkwTaZG4I5l4Rto0hErUf3qx7FlZjMGEFMdJVskgnRMkKdqngF0FmSYQICpmqqYD8TydUc6jxZVOCvFF5gbqwxV/F2lk10D7FnetUNeWvpcZKbFUX4e5Ff15vibJZp4/5FUbksv+glfbPwk6tGuNj3xPFODP7KG8Y5wtcbknX11XI0vi+iL8TxL0Vk30TpZUMXWYYvQ==
20-
sshKeySecureFile: id_rsa
21-
22-
- script: git submodule init && git submodule deinit script && git submodule update
23-
displayName: Submodule init
16+
- checkout: self
17+
submodules: true
2418

2519
# Can't use the NuGet tasks because of https://github.com/Microsoft/azure-pipelines-tasks/issues/6790
2620
#- task: NuGetToolInstaller@0
@@ -54,7 +48,7 @@ steps:
5448
platform: '$(buildPlatform)'
5549
configuration: '$(buildConfiguration)'
5650
msbuildVersion: '16.0'
57-
msbuildArguments: '/property:DeployExtension=False'
51+
msbuildArguments: '/property:DeployExtension=False;GitHubVS_ClientId=$(GitHubVS_ClientId);GitHubVS_ClientSecret=$(GitHubVS_ClientSecret)'
5852

5953
- task: MSBuild@1
6054
displayName: GitHub Essentials

script

Lines changed: 0 additions & 1 deletion
This file was deleted.

signingkey.snk

-596 Bytes
Binary file not shown.

src/GitHub.Api/ApiClientConfiguration_User.cs

Lines changed: 0 additions & 16 deletions
This file was deleted.

src/GitHub.Api/GitHub.Api.csproj

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,34 @@
77

88
<Import Project="$(SolutionDir)\src\common\signing.props" />
99

10-
<ItemGroup Condition="$(Buildtype) == 'Internal'">
11-
<Compile Remove="ApiClientConfiguration_User.cs" />
12-
<Compile Include="..\..\script\src\ApiClientConfiguration_User.cs">
13-
<Link>ApiClientConfiguration_User.cs</Link>
14-
</Compile>
15-
</ItemGroup>
16-
10+
<Target Name="AddClientSecret" BeforeTargets="BeforeCompile"
11+
Inputs="$(MSBuildThisFileFullPath)" Outputs="$(IntermediateOutputPath)ApiClientConfiguration.$(GitHubVS_ClientId).cs">
12+
<Error Condition="'$(GitHubVS_ClientId)' == '' OR '$(GitHubVS_ClientSecret)' == ''"
13+
Text="Please define 'GitHubVS_ClientId' and 'GitHubVS_ClientSecret' environment variables (restart Visual Studio if necessary)" />
14+
<PropertyGroup>
15+
<GeneratedFilePath>$(IntermediateOutputPath)ApiClientConfiguration.$(GitHubVS_ClientId).cs</GeneratedFilePath>
16+
<GeneratedText>
17+
<![CDATA[
18+
namespace GitHub.Api
19+
{
20+
static partial class ApiClientConfiguration
21+
{
22+
static partial void Configure()
23+
{
24+
ClientId = "$(GitHubVS_ClientId)"%3b
25+
ClientSecret = "$(GitHubVS_ClientSecret)"%3b
26+
}
27+
}
28+
}
29+
]]>
30+
</GeneratedText>
31+
</PropertyGroup>
32+
<ItemGroup>
33+
<Compile Include="$(GeneratedFilePath)" />
34+
</ItemGroup>
35+
<WriteLinesToFile File="$(GeneratedFilePath)" Lines="$(GeneratedText)" WriteOnlyWhenDifferent="true" Overwrite="true" />
36+
</Target>
37+
1738
<ItemGroup>
1839
<Reference Include="System.ComponentModel.Composition" />
1940
<Reference Include="System.Net.Http" />

src/common/signing.props

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,14 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<PropertyGroup>
4-
<BuildType Condition="Exists('..\..\script\key.snk')">Internal</BuildType>
5-
</PropertyGroup>
6-
7-
<PropertyGroup Condition="'$(BuildType)' == 'Internal'">
8-
<AssemblyOriginatorKeyFile>..\..\script\key.snk</AssemblyOriginatorKeyFile>
9-
<SignAssembly>true</SignAssembly>
10-
<DelaySign>false</DelaySign>
11-
</PropertyGroup>
12-
13-
<PropertyGroup Condition="'$(BuildType)' != 'Internal' and Exists('..\..\signingkey')">
14-
<AssemblyOriginatorKeyFile>..\..\signingkey.snk</AssemblyOriginatorKeyFile>
4+
<AssemblyOriginatorKeyFile>..\..\key.snk</AssemblyOriginatorKeyFile>
155
<SignAssembly>true</SignAssembly>
166
<DelaySign>false</DelaySign>
177
</PropertyGroup>
188

199
<ItemGroup>
20-
<None Include="..\..\script\key.snk" Condition="'$(BuildType)' == 'Internal'">
10+
<None Include="..\..\key.snk">
2111
<Link>key.snk</Link>
2212
</None>
23-
24-
<None Include="..\..\signingkey" Condition="'$(BuildType)' != 'Internal' and Exists('..\..\signingkey')">
25-
<Link>signingkey</Link>
26-
</None>
2713
</ItemGroup>
2814
</Project>

0 commit comments

Comments
 (0)