Skip to content

Commit

Permalink
Fixed versioning. (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
mgernand authored Dec 17, 2021
1 parent bd02e4f commit 4d89a5e
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 112 deletions.
11 changes: 8 additions & 3 deletions Fluxera.ValueObject.sln
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".items", ".items", "{75AC41
ProjectSection(SolutionItems) = preProject
.gitignore = .gitignore
azure-pipelines.yml = azure-pipelines.yml
Directory.Build.props = Directory.Build.props
GitVersion.yml = GitVersion.yml
global.json = global.json
icon.png = icon.png
Expand All @@ -16,12 +15,18 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".items", ".items", "{75AC41
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{DF28D730-99B3-4811-AAC7-725A73B3F668}"
ProjectSection(SolutionItems) = preProject
src\Directory.Build.props = src\Directory.Build.props
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{F18D2D58-282C-4D93-8D9A-3A76CF98F018}"
ProjectSection(SolutionItems) = preProject
tests\Directory.Build.props = tests\Directory.Build.props
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Fluxera.ValueObject", "src\Fluxera.ValueObject\Fluxera.ValueObject.csproj", "{0112DE42-7C32-4ECC-A5C1-6839C63A689C}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Fluxera.ValueObject", "src\Fluxera.ValueObject\Fluxera.ValueObject.csproj", "{0112DE42-7C32-4ECC-A5C1-6839C63A689C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Fluxera.ValueObject.UnitTests", "tests\Fluxera.ValueObject.UnitTests\Fluxera.ValueObject.UnitTests.csproj", "{6F6CAF72-1D71-434B-AD09-7A9216669502}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Fluxera.ValueObject.UnitTests", "tests\Fluxera.ValueObject.UnitTests\Fluxera.ValueObject.UnitTests.csproj", "{6F6CAF72-1D71-434B-AD09-7A9216669502}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
5 changes: 0 additions & 5 deletions GitVersion.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
next-version: 6.0.0
mode: Mainline

branches:
master:
regex: ^master$|^main$
72 changes: 6 additions & 66 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,40 +7,31 @@ trigger:

variables:
BuildConfiguration: Release
DotNetCoreVersion: 6.0.100
DotNetCoreVersion: 6.0.101

stages:
- stage: BuildAndTest
jobs:
- job: BuildAndTest
pool:
vmImage: 'windows-latest'
name: Default
steps:
- checkout: self
persistCredentials: 'true'
clean: true
# Run GitVersion to acquire the current build version.
- task: GitVersion@5
displayName: 'Acquire and Apply Version'
inputs:
updateAssemblyInfo: true
updateAssemblyInfoFilename: 'src/SolutionInfo.cs'
additionalArguments: '/ensureassemblyinfo'
configFilePath: 'GitVersion.yml'
# Install the desired .NET SDK.
- task: UseDotNet@2
displayName: 'Acquire .NET SDK'
inputs:
packageType: 'sdk'
version: $(DotNetCoreVersion)
includePreviewVersions: true
includePreviewVersions: false
# Build all projects.
- task: DotNetCoreCLI@2
displayName: 'Build Projects'
inputs:
projects: '**/*.csproj'
arguments: '--configuration $(BuildConfiguration)'
nugetConfigPath: NuGet.config
# Run all available tests.
- task: DotNetCoreCLI@2
displayName: 'Execute Tests'
Expand All @@ -49,70 +40,19 @@ stages:
projects: '**/*Tests/*.csproj'
arguments: '--configuration $(BuildConfiguration)'
nobuild: true
# Set the version to a environment variable. This will be used in the NuGet pack task.
- script: echo %Action%%SemVerEnv%
displayName: 'Set Package Version Variable'
env:
Action: '##vso[task.setvariable variable=NuGetPackageVersion]'
SemVerEnv: $(GitVersion.SemVer)
# Create the NuGet packages.
- task: DotNetCoreCLI@2
displayName: 'NuGet Pack Packages'
displayName: 'Pack Packages'
inputs:
command: 'pack'
packagesToPack: 'src/**/*.csproj'
nobuild: true
versioningScheme: 'byEnvVar'
versionEnvVar: 'NuGetPackageVersion'
verbosityPack: Minimal
includesymbols: false
# Copy created NuGet packages to the builds artifacts directory.
- task: PublishBuildArtifacts@1
displayName: 'NuGet Publish Package Artifacts'
displayName: 'Publish Package Artifacts'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'drop'
publishLocation: 'Container'
#- stage: DeployPackages
# dependsOn: BuildAndTest
# # Only publish packages for main, develop (alpha) and release (beta) branches.
# condition: and(succeeded('BuildAndTest'), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'), eq(variables['Build.SourceBranch'], 'refs/heads/develop'), startsWith(variables['Build.SourceBranch'], 'refs/heads/release/')))
# jobs:
# - job: DeployPackages
# pool:
# vmImage: 'windows-latest'
# steps:
# - checkout: self
# persistCredentials: 'true'
# clean: true
# # Run GitVersion to acquire the current build version.
# - task: GitVersion@5
# displayName: 'Acquire and Apply Version'
# inputs:
# updateAssemblyInfo: false
# configFilePath: 'GitVersion.yml'
# # Download the created packages.
# - task: DownloadBuildArtifacts@0
# inputs:
# buildType: 'current'
# downloadType: 'single'
# artifactName: 'drop'
# downloadPath: '$(System.ArtifactsDirectory)'
# # Publish the NuGet packages to the package feed.
# # https://www.programmingwithwolfgang.com/azure-devops-publish-nuget/
# - task: DotNetCoreCLI@2
# condition: not(contains(variables['Build.BuildNumber'], '-ci'))
# displayName: 'NuGet Push Packages'
# inputs:
# command: custom
# custom: nuget
# arguments: >
# push $(System.ArtifactsDirectory)/**/*.nupkg
# -s https://api.nuget.org/v3/index.json
# -k $(NuGetApiKey)
# #command: 'push'
# #packagesToPush: '$(System.ArtifactsDirectory)/**/*.nupkg'
# #nuGetFeedType: 'external'
# #publishFeedCredentials: 'Foundation'
# #verbosityRestore: Normal
# #includesymbols: false
publishLocation: 'Container'
18 changes: 9 additions & 9 deletions Directory.Build.props → src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,16 @@

<PropertyGroup>
<LangVersion>latest</LangVersion>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<Nullable>enable</Nullable>
<ImplicitUsings>disable</ImplicitUsings>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
</PropertyGroup>

<PropertyGroup>
<Company>Fluxera Software Development GmbH</Company>
<Copyright>Copyright © 2014-2021 Fluxera Software Development GmbH. All rights reserved.</Copyright>
<Product>Fluxera Software Foundation</Product>
</PropertyGroup>

<PropertyGroup>
<Version>6.0.0</Version>
<AssemblyVersion>6.0.0</AssemblyVersion>
<FileVersion>6.0.0</FileVersion>
<Copyright>Copyright © 2014-2021 Fluxera Software Development GmbH. All rights reserved.</Copyright>
</PropertyGroup>

<PropertyGroup>
Expand All @@ -30,7 +25,12 @@
<NeutralLanguage>en</NeutralLanguage>
<RepositoryType>git</RepositoryType>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
</PropertyGroup>

<Target Name="Update Version" BeforeTargets="Build" Condition="'$(TF_BUILD)' == 'true'">
<Message Text="Version = $(GITVERSION_FullSemVer)" Importance="High" />
<Message Text="##vso[build.updatebuildnumber]$(GITVERSION_FullSemVer)" Importance="High" />
</Target>

</Project>
13 changes: 7 additions & 6 deletions src/Fluxera.ValueObject/Fluxera.ValueObject.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,11 @@
</PropertyGroup>

<PropertyGroup>
<PackageTags>fluxera;library;ddd;value-object</PackageTags>
<Title>Fluxera.ValueObject</Title>
<Description>An extendable guard implementation.</Description>
<PackageTags>fluxera;library;ddd;value-object</PackageTags>
</PropertyGroup>

<ItemGroup>
<Compile Include="..\SolutionInfo.cs" Link="Properties\SolutionInfo.cs" />
</ItemGroup>

<ItemGroup>
<None Include="..\..\README.md" Link="Properties\README.md">
<Pack>true</Pack>
Expand All @@ -25,7 +22,11 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Fluxera.Guards" Version="6.0.5" />
<PackageReference Include="Fluxera.Guards" Version="6.0.7" />
<PackageReference Include="GitVersion.MsBuild" Version="5.8.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="JetBrains.Annotations" Version="2021.3.0" />
</ItemGroup>
</Project>
4 changes: 0 additions & 4 deletions src/Fluxera.ValueObject/Properties/AssemblyInfo.cs

This file was deleted.

18 changes: 0 additions & 18 deletions src/SolutionInfo.cs

This file was deleted.

17 changes: 17 additions & 0 deletions tests/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<Project>

<PropertyGroup>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>disable</ImplicitUsings>
<GenerateDocumentationFile>false</GenerateDocumentationFile>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
</PropertyGroup>

<PropertyGroup>
<Company>Fluxera Software Development GmbH</Company>
<Product>Fluxera Software Foundation</Product>
<Copyright>Copyright © 2014-2021 Fluxera Software Development GmbH. All rights reserved.</Copyright>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.2.0" />
<PackageReference Include="Fluxera.Guards" Version="6.0.5" />
<PackageReference Include="Fluxera.Guards" Version="6.0.7" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="NUnit" Version="3.13.2" />
<PackageReference Include="NUnit3TestAdapter" Version="4.1.0" />
Expand Down

0 comments on commit 4d89a5e

Please sign in to comment.