Skip to content

Commit

Permalink
Merge pull request #12 from microsoft/dev/sknam/produce-single-file-e…
Browse files Browse the repository at this point in the history
…xecutable

Add support for publishing a single file executable
  • Loading branch information
skylarnam authored Feb 23, 2023
2 parents 11628c9 + 94aa8b4 commit 98e9166
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/actions-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,7 @@ jobs:
run: dotnet build --no-restore --configuration ${{ env.BUILD_CONFIGURATION }} ${{ env.PROJECT_PATH }}

- name: Test
run: dotnet test --verbosity normal --configuration ${{ env.BUILD_CONFIGURATION }} ${{ env.TEST_PROJECT_PATH }}
run: dotnet test --verbosity normal --configuration ${{ env.BUILD_CONFIGURATION }} ${{ env.TEST_PROJECT_PATH }}

- name: Publish
run: dotnet publish --no-build --configuration ${{ env.BUILD_CONFIGURATION }} ${{ env.TEST_PROJECT_PATH }}
10 changes: 9 additions & 1 deletion VSConfigFinder/VSConfigFinder.csproj
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PublishSingleFile>true</PublishSingleFile>
<SelfContained>true</SelfContained>
<PublishTrimmed>true</PublishTrimmed>
<PublishPath>$(OutputPath)$(RuntimeIdentifier)\publish\</PublishPath>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CommandLineParser" Version="2.9.1" />
<PackageReference Include="Microsoft.VisualStudioEng.MicroBuild.Core" Version="1.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
Expand Down
6 changes: 6 additions & 0 deletions vsts-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ steps:
projects: 'VSConfigFinder.Test'
arguments: '--configuration $(BuildConfiguration)'

- task: DotNetCoreCLI@2
displayName: Publish
inputs:
command: 'publish'
arguments: '--no-build --configuration $(BuildConfiguration)'

- task: CopyFiles@2
displayName: 'Copy build artifacts from: $(Build.SourcesDirectory)\VSConfigFinder\bin\$(BuildConfiguration)\** to $(Build.ArtifactStagingDirectory)\out'
inputs:
Expand Down

0 comments on commit 98e9166

Please sign in to comment.