Skip to content

Commit 65b27ac

Browse files
authored
Merge branch 'master' into sw/issue-28
2 parents cd86e3c + 8e10c1a commit 65b27ac

10 files changed

Lines changed: 48 additions & 61 deletions

.github/workflows/build-and-test.yml

Lines changed: 7 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -52,31 +52,14 @@ jobs:
5252
git fetch --prune --unshallow
5353
git submodule -q update --init --recursive
5454
55-
- name: Fetch Tags for GitVersion
56-
run: |
57-
git fetch --tags
58-
59-
- name: Fetch master for GitVersion
60-
if: github.ref != 'refs/heads/master'
61-
run: git branch --create-reflog master origin/master
62-
63-
- name: Install GitVersion
64-
uses: gittools/actions/setup-gitversion@v0.3
65-
with:
66-
versionSpec: "5.1.x"
67-
68-
- name: Use GitVersion
69-
id: gitversion # step id used as reference for output values
70-
uses: gittools/actions/execute-gitversion@v0.3
71-
7255
- name: Setup DotNet SDK
7356
uses: actions/setup-dotnet@v1
7457
with:
75-
dotnet-version: "3.1.101"
58+
dotnet-version: "3.1.x"
7659

7760
- name: Build
7861
shell: pwsh
79-
run: ./ci-build.ps1 "${{steps.gitversion.outputs.nuGetVersion}}" "${{matrix.options.framework}}"
62+
run: ./ci-build.ps1 "${{matrix.options.framework}}"
8063

8164
- name: Test
8265
shell: pwsh
@@ -112,33 +95,17 @@ jobs:
11295
git fetch --prune --unshallow
11396
git submodule -q update --init --recursive
11497
115-
- name: Fetch Tags for GitVersion
116-
run: |
117-
git fetch --tags
118-
119-
- name: Fetch master for GitVersion
120-
if: github.ref != 'refs/heads/master'
121-
run: git branch --create-reflog master origin/master
122-
123-
- name: Install GitVersion
124-
uses: gittools/actions/setup-gitversion@v0.3
125-
with:
126-
versionSpec: "5.1.x"
127-
128-
- name: Use GitVersion
129-
id: gitversion # step id used as reference for output values
130-
uses: gittools/actions/execute-gitversion@v0.3
131-
13298
- name: Setup DotNet SDK
13399
uses: actions/setup-dotnet@v1
134100
with:
135-
dotnet-version: "3.1.101"
101+
dotnet-version: "3.1.x"
136102

137103
- name: Pack
138104
shell: pwsh
139-
run: ./ci-pack.ps1 "${{steps.gitversion.outputs.nuGetVersion}}"
105+
run: ./ci-pack.ps1
140106

141107
- name: Publish to MyGet
142108
shell: pwsh
143-
run: nuget.exe push .\artifacts\*.nupkg ${{secrets.MYGET_TOKEN}} -Source https://www.myget.org/F/sixlabors/api/v2/package
144-
# TODO: If github.ref starts with 'refs/tags' then it was tag push and we can optionally push out package to nuget.org
109+
run: |
110+
nuget.exe push .\artifacts\*.nupkg ${{secrets.MYGET_TOKEN}} -Source https://www.myget.org/F/sixlabors/api/v2/package
111+
nuget.exe push .\artifacts\*.snupkg ${{secrets.MYGET_TOKEN}} -Source https://www.myget.org/F/sixlabors/api/v3/index.json

Directory.Build.props

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
<DebugType Condition="'$(codecov)' != ''">full</DebugType>
2525
<NullableContextOptions>disable</NullableContextOptions>
2626
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
27-
<SignAssembly>false</SignAssembly>
2827
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
2928
</PropertyGroup>
3029

@@ -73,6 +72,12 @@
7372
<VersionSuffix></VersionSuffix>
7473
</PropertyGroup>
7574

75+
<!--MinVer Properties for versioning-->
76+
<PropertyGroup>
77+
<MinVerTagPrefix>v</MinVerTagPrefix>
78+
<MinVerVerbosity>normal</MinVerVerbosity>
79+
</PropertyGroup>
80+
7681
<!-- Default settings that are otherwise undefined -->
7782
<PropertyGroup>
7883
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)shared-infrastructure/SixLabors.snk</AssemblyOriginatorKeyFile>

Directory.Build.targets

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
<PackageReference Update="Microsoft.NETFramework.ReferenceAssemblies" PrivateAssets="All" Version="1.0.0" />
2323
<PackageReference Update="StyleCop.Analyzers" PrivateAssets="All" Version="1.1.118" />
2424

25+
<PackageReference Update="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All"/>
26+
<PackageReference Update="MinVer" PrivateAssets="All" Version="2.3.0" />
27+
2528
<!--Src Dependencies-->
2629
<PackageReference Update="SixLabors.Fonts" Version="1.0.0-beta0013" />
2730
<PackageReference Update="SixLabors.ImageSharp" Version="1.0.0-rc0003" />

GitVersion.yml

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

ci-build.ps1

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
param(
2-
[Parameter(Mandatory, Position = 0)]
3-
[string]$version,
4-
[Parameter(Mandatory = $true, Position = 1)]
2+
[Parameter(Mandatory = $true, Position = 0)]
53
[string]$targetFramework
64
)
75

@@ -10,4 +8,4 @@ dotnet clean -c Release
108
$repositoryUrl = "https://github.com/$env:GITHUB_REPOSITORY"
119

1210
# Building for a specific framework.
13-
dotnet build -c Release -f $targetFramework /p:packageversion=$version /p:RepositoryUrl=$repositoryUrl
11+
dotnet build -c Release -f $targetFramework /p:RepositoryUrl=$repositoryUrl

ci-pack.ps1

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
1-
param(
2-
[Parameter(Mandatory, Position = 0)]
3-
[string]$version
4-
)
5-
61
dotnet clean -c Release
72

83
$repositoryUrl = "https://github.com/$env:GITHUB_REPOSITORY"
94

105
# Building for packing and publishing.
11-
dotnet pack -c Release --output "$PSScriptRoot/artifacts" /p:packageversion=$version /p:RepositoryUrl=$repositoryUrl
6+
dotnet pack -c Release --output "$PSScriptRoot/artifacts" /p:RepositoryUrl=$repositoryUrl

src/Directory.Build.props

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,19 @@
2626
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
2727
</PropertyGroup>
2828

29+
<!--Add deterministic builds in CI-->
30+
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
31+
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
32+
<EmbedUntrackedSources>true</EmbedUntrackedSources>
33+
</PropertyGroup>
34+
35+
<PropertyGroup>
36+
<PublishRepositoryUrl>true</PublishRepositoryUrl>
37+
<!-- Build symbol package (.snupkg) to distribute the PDB containing Source Link -->
38+
<IncludeSymbols>true</IncludeSymbols>
39+
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
40+
</PropertyGroup>
41+
2942
<ItemGroup>
3043
<!--TODO: Delete this once tests Stylecop issues are fixed-->
3144
<PackageReference Include="StyleCop.Analyzers" IsImplicitlyDefined="true" />

src/Directory.Build.targets

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,17 @@
2020
<GeneratedInternalsVisibleToFile Condition="'$(GeneratedInternalsVisibleToFile)' == ''">$(IntermediateOutputPath)$(MSBuildProjectName).InternalsVisibleTo$(DefaultLanguageSourceExtension)</GeneratedInternalsVisibleToFile>
2121
</PropertyGroup>
2222

23+
<!-- Workaround for running Coverlet with Determenistic builds -->
24+
<!-- https://github.com/coverlet-coverage/coverlet/blob/master/Documentation/DeterministicBuild.md -->
25+
<Target Name="CoverletGetPathMap"
26+
DependsOnTargets="InitializeSourceRootMappedPaths"
27+
Returns="@(_LocalTopLevelSourceRoot)"
28+
Condition="'$(DeterministicSourcePaths)' == 'true'">
29+
<ItemGroup>
30+
<_LocalTopLevelSourceRoot Include="@(SourceRoot)" Condition="'%(SourceRoot.NestedRoot)' == ''"/>
31+
</ItemGroup>
32+
</Target>
33+
2334
<ItemDefinitionGroup>
2435
<InternalsVisibleTo>
2536
<Visible>false</Visible>

src/ImageSharp.Drawing/ImageSharp.Drawing.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
<ItemGroup>
1616
<PackageReference Include="SixLabors.Fonts" />
1717
<PackageReference Include="SixLabors.ImageSharp" />
18+
<PackageReference Include="Microsoft.SourceLink.GitHub"/>
19+
<PackageReference Include="MinVer" PrivateAssets="All" />
1820
</ItemGroup>
1921

2022
<Import Project="..\..\shared-infrastructure\src\SharedInfrastructure\SharedInfrastructure.projitems" Label="Shared" />

tests/Directory.Build.targets

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@
2525

2626
<ItemGroup>
2727
<!--Test Dependencies-->
28-
<PackageReference Update="BenchmarkDotNet" Version="0.12.0" />
29-
<PackageReference Update="coverlet.collector" Version="1.2.0" PrivateAssets="All"/>
28+
<PackageReference Update="BenchmarkDotNet" Version="0.12.1" />
29+
<PackageReference Update="coverlet.collector" Version="1.3.0" PrivateAssets="All"/>
3030
<PackageReference Update="Magick.NET-Q16-AnyCPU" Version="7.14.4" />
3131
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="16.5.0-preview-20200116-01" />
3232
<PackageReference Update="Moq" Version="4.10.0" />
3333
<PackageReference Update="System.Drawing.Common" Version="4.7.0" />
3434
<PackageReference Update="xunit" Version="2.4.1" />
3535
<PackageReference Update="xunit.runner.visualstudio" Version="2.4.1" />
3636
</ItemGroup>
37-
37+
3838
</Project>

0 commit comments

Comments
 (0)