Skip to content

Commit e522d71

Browse files
authored
publish self-contained releases using Azure Pipelines (#15)
- publish self-contained release for Linux-x64, Win-x64 and MacOS-x64 - automate GitHub release creation (pipeline configuration is on Azure DevOps)
1 parent 692c643 commit e522d71

File tree

2 files changed

+25
-12
lines changed

2 files changed

+25
-12
lines changed

SayIt/SayIt.fsproj

-9
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,6 @@
55
<TargetFramework>netcoreapp3.0</TargetFramework>
66
</PropertyGroup>
77

8-
<PropertyGroup>
9-
<RuntimeIdentifier>linux-x64</RuntimeIdentifier>
10-
<PublishSingleFile>true</PublishSingleFile>
11-
<PublishTrimmed>true</PublishTrimmed>
12-
13-
<!-- this increases size and reduces startup time -->
14-
<PublishReadyToRun>true</PublishReadyToRun>
15-
</PropertyGroup>
16-
178
<ItemGroup>
189
<Compile Include="Config.fs" />
1910
<Compile Include="Program.fs" />

azure-pipelines.yml

+25-3
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,27 @@ strategy:
1111
matrix:
1212
Linux:
1313
imageName: 'ubuntu-latest'
14+
rid: 'linux-x64'
15+
artifact: 'sayit-linux-x64'
1416
Mac:
1517
imageName: 'macos-latest'
18+
rid: 'osx-x64'
19+
artifact: 'sayit-osx-x64'
1620
Windows:
1721
imageName: 'vs2017-win2016'
22+
rid: 'win-x64'
23+
artifact: 'sayit-win-x64'
1824

1925
pool:
2026
vmImage: $(imageName)
2127

2228
variables:
2329
buildConfiguration: 'Release'
30+
framework: netcoreapp3.0
2431

2532
steps:
2633
- task: UseDotNet@2
27-
displayName: 'Install .NET Core SDK'
34+
displayName: Install .NET Core SDK
2835
inputs:
2936
version: 3.0.100
3037

@@ -33,10 +40,25 @@ steps:
3340
inputs:
3441
command: build
3542
projects: '**/*.fsproj'
36-
arguments: '--configuration $(buildConfiguration)'
43+
arguments: '-c $(buildConfiguration)'
3744

3845
- task: DotNetCoreCLI@2
46+
displayName: Run tests
3947
inputs:
4048
command: test
4149
projects: '**/*Tests/*.fsproj'
42-
arguments: '--configuration $(buildConfiguration) --collect "Code coverage"'
50+
arguments: '-c $(buildConfiguration)'
51+
52+
- task: DotNetCoreCLI@2
53+
displayName: Publish release
54+
inputs:
55+
command: publish
56+
publishWebProjects: False
57+
projects: 'SayIt/SayIt.fsproj'
58+
arguments: '-c $(BuildConfiguration) -f $(framework) /p:RuntimeIdentifier=$(rid) /p:PublishSingleFile=true /p:PublishReadyToRun=true /p:UseAppHost=true --output $(Build.ArtifactStagingDirectory)'
59+
60+
- task: PublishBuildArtifacts@1
61+
displayName: Publish artifact
62+
inputs:
63+
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
64+
artifactName: '$(artifact)'

0 commit comments

Comments
 (0)