Skip to content

Commit

Permalink
sourcelink + snupkg support (#134)
Browse files Browse the repository at this point in the history
  • Loading branch information
MaceWindu authored Apr 30, 2021
1 parent d5f98aa commit f62c96f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,19 @@
<LangVersion>latest</LangVersion>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='Release'">
<DebugType>portable</DebugType>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<DebugSymbols>true</DebugSymbols>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="linq2db" Version="3.3.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="3.1.11" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>

</Project>
17 changes: 14 additions & 3 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,37 +44,48 @@ stages:
inputs:
solution: '$(solution)'
configuration: '$(build_configuration)'
msbuildArguments: '/t:Restore;Rebuild -m'
msbuildArguments: '/t:Restore;Rebuild -m /p:ContinuousIntegrationBuild=true'
displayName: Build Solution

- powershell: echo "##vso[task.setvariable variable=packageVersion]$(packageVersion)-rc.$(Build.BuildId)"
condition: ne(variables['Build.SourceBranchName'], 'release.3')
displayName: Set nuget RC version for non-release branch
condition: and(succeeded(), eq(variables['Build.SourceBranchName'], 'version3'))

- task: PowerShell@2
inputs:
filePath: '$(Build.SourcesDirectory)/NuGet/BuildNuspecs.ps1'
workingDirectory: '$(Build.SourcesDirectory)'
arguments: -path $(Build.SourcesDirectory)/NuGet/linq2db.EntityFrameworkCore.nuspec -version $(packageVersion) -branch $(Build.SourceBranchName)
displayName: Generate nuspec
condition: and(succeeded(), or(eq(variables['Build.SourceBranchName'], 'release.3'), eq(variables['Build.SourceBranchName'], 'version3')))

- task: NuGetToolInstaller@0
inputs:
versionSpec: '5.x'
workingDirectory: $(Build.SourcesDirectory)/NuGet
displayName: Install nuget
condition: and(succeeded(), or(eq(variables['Build.SourceBranchName'], 'release.3'), eq(variables['Build.SourceBranchName'], 'version3')))

- task: CmdLine@2
inputs:
script: 'nuget Pack linq2db.EntityFrameworkCore.nuspec -OutputDirectory built'
workingDirectory: $(Build.SourcesDirectory)/NuGet
displayName: Build nuget
displayName: Build nuget (azure artifacts)
condition: and(succeeded(), eq(variables['Build.SourceBranchName'], 'version3'))

- task: CmdLine@2
inputs:
script: 'nuget Pack linq2db.EntityFrameworkCore.nuspec -OutputDirectory built -Symbols -SymbolPackageFormat snupkg'
workingDirectory: $(Build.SourcesDirectory)/NuGet
displayName: Build nuget (nuget.org)
condition: and(succeeded(), eq(variables['Build.SourceBranchName'], 'release.3'))

- task: PublishBuildArtifacts@1
inputs:
pathToPublish: '$(Build.SourcesDirectory)/NuGet/built'
artifactName: '$(artifact_nugets)'
displayName: Publish nugets to artifacts
condition: and(succeeded(), or(eq(variables['Build.SourceBranchName'], 'release.3'), eq(variables['Build.SourceBranchName'], 'version3')))

- task: NuGetCommand@2
inputs:
Expand Down

0 comments on commit f62c96f

Please sign in to comment.