Skip to content

Commit 51ef536

Browse files
committed
using corert for publishing single executable file
1 parent 559d8d1 commit 51ef536

File tree

4 files changed

+62
-2
lines changed

4 files changed

+62
-2
lines changed

azure-pipelines.yml

+37-2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,16 @@ stages:
1414
rid: "win-x64"
1515
PLATFORMLINKER: ""
1616
ExE_FILE_ExT: ".exe"
17+
linux-x64:
18+
imageName: 'ubuntu-16.04'
19+
rid: "linux-x64"
20+
PLATFORMLINKER: "clang-6.0"
21+
EXE_FILE_EXT: ""
22+
macos-x64:
23+
imageName: "macos-10.13"
24+
rid: "osx-x64"
25+
PLATFORMLINKER: ""
26+
EXE_FILE_EXT: ""
1727
pool:
1828
vmImage: $(imageName)
1929

@@ -52,7 +62,7 @@ stages:
5262
inputs:
5363
command: "custom"
5464
custom: "publish"
55-
arguments: "-c Release"
65+
arguments: "-c Release -r $(rid) -p:PackAsTool=false"
5666
projects: "dotnet-ansible-vault-decoder/dotnet-ansible-vault-decoder.csproj"
5767
publishWebProjects: false
5868
- task: CopyFiles@2
@@ -61,6 +71,21 @@ stages:
6171
sourceFolder: "dotnet-ansible-vault-decoder/bin/Release"
6272
contents: "**/*.nupkg"
6373
targetFolder: "$(Build.ArtifactStagingDirectory)"
74+
- task: CopyFiles@2
75+
name: "copying_executable"
76+
displayName: "copying binary executable"
77+
inputs:
78+
sourceFolder: "dotnet-ansible-vault-decoder/bin/Release/netcoreapp2.1/$(rid)/native/"
79+
contents: "dotnet-ansible-vault-decoder$(ExE_FILE_ExT)"
80+
targetFolder: "$(Build.ArtifactStagingDirectory)/dotnet-anv-$(rid)$(EXE_FILE_EXT)"
81+
- task: CopyFiles@2
82+
name: "copying_executable"
83+
displayName: "copying pdb"
84+
inputs:
85+
sourceFolder: "dotnet-ansible-vault-decoder/bin/Release/netcoreapp2.1/$(rid)/native/"
86+
contents: "dotnet-ansible-vault-decoder.pdb"
87+
targetFolder: "$(Build.ArtifactStagingDirectory)/dotnet-anv-$(rid).pdb"
88+
condition: "eq(variables['imageName'],'windows-2019')"
6489
- task: PublishBuildArtifacts@1
6590
name: "publishing_artifacts"
6691
inputs:
@@ -79,12 +104,22 @@ stages:
79104
inputs:
80105
artifact: dotnet-anv-win-x64
81106
path: "$(Build.ArtifactStagingDirectory)"
107+
- task: DownloadPipelineArtifact@2
108+
displayName: download linux-x64
109+
inputs:
110+
artifact: dotnet-anv-linux-x64
111+
path: "$(Build.ArtifactStagingDirectory)"
112+
- task: DownloadPipelineArtifact@2
113+
displayName: download osx-x64
114+
inputs:
115+
artifact: dotnet-anv-osx-x64
116+
path: "$(Build.ArtifactStagingDirectory)"
82117
- task: GitHubRelease@0
83118
displayName: "releasing github"
84119
inputs:
85120
gitHubConnection: "dotnet-ansible-vault-decoder"
86121
action: create
87122
target: "$(Build.SourceVersion)"
88-
assets: "$(Build.ArtifactStagingDirectory)/*"
123+
assets: "$(Build.ArtifactStagingDirectory)/**/*"
89124
isDraft: true
90125

dotnet-ansible-vault-decoder/dotnet-ansible-vault-decoder.csproj

+7
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,18 @@
1515
<Authors>itn3000</Authors>
1616
<PackageLicenseExpression>MIT</PackageLicenseExpression>
1717
</PropertyGroup>
18+
<PropertyGroup Condition="'$(EnableCoreRT)' != 'true'">
19+
<!-- <NativeCompilationDuringPublish>false</NativeCompilationDuringPublish> -->
20+
</PropertyGroup>
1821

1922
<ItemGroup>
2023
<PackageReference Include="McMaster.Extensions.CommandlineUtils" Version="2.3.4" />
2124
<PackageReference Include="Portable.BouncyCastle" Version="1.8.5" />
2225
<PackageReference Include="System.Memory" Version="4.5.3" />
26+
<PackageReference Include="Microsoft.DotNet.ILCompiler" Version="1.0.0-alpha-*" />
27+
</ItemGroup>
28+
<ItemGroup>
29+
<RdXmlFile Include="rd.xml"/>
2330
</ItemGroup>
2431

2532
</Project>

dotnet-ansible-vault-decoder/rd.xml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata">
2+
<Application>
3+
<Assembly Name="BouncyCastle.Crypto">
4+
<Type Name="Org.BouncyCastle.Security.CipherUtilities+CipherAlgorithm[]" Dynamic="Required All" />
5+
<Type Name="Org.BouncyCastle.Security.CipherUtilities+CipherMode[]" Dynamic="Required All" />
6+
<Type Name="Org.BouncyCastle.Security.CipherUtilities+CipherPadding[]" Dynamic="Required All" />
7+
</Assembly>
8+
</Application>
9+
</Directives>

nuget.config

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<packageSources>
4+
<!--To inherit the global NuGet package sources remove the <clear/> line below -->
5+
<clear />
6+
<add key="dotnet-core" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json"/>
7+
<add key="nuget" value="https://api.nuget.org/v3/index.json" />
8+
</packageSources>
9+
</configuration>

0 commit comments

Comments
 (0)