Skip to content

Commit

Permalink
Merge branch 'feature/buildRework'
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeavon committed Nov 21, 2017
2 parents f0d0697 + 582a8d1 commit 35f5cf6
Show file tree
Hide file tree
Showing 17 changed files with 143 additions and 133 deletions.
7 changes: 6 additions & 1 deletion Our.Umbraco.HCSlackNM.sln
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26430.16
VisualStudioVersion = 15.0.27004.2008
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Our.Umbraco.HCSlackNM", "src\Our.Umbraco.HCSlackNM\Our.Umbraco.HCSlackNM.csproj", "{020C131C-CB5F-4DAB-85B9-A387F2427421}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestSite", "src\TestSite\TestSite.csproj", "{479C3FC5-8625-4AE8-ACCC-144B7F8376ED}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{470FA32D-9976-47CA-AD4F-EC414A18043F}"
ProjectSection(SolutionItems) = preProject
build\appveyor-semver.ps1 = build\appveyor-semver.ps1
appveyor.yml = appveyor.yml
build-appveyor.cmd = build-appveyor.cmd
build.cmd = build.cmd
build\check-release-version.ps1 = build\check-release-version.ps1
build\HCSlackNM.proj = build\HCSlackNM.proj
build\package.nuspec = build\package.nuspec
build\package.proj = build\package.proj
Expand Down Expand Up @@ -52,4 +54,7 @@ Global
GlobalSection(NestedProjects) = preSolution
{E26FE0B6-B4B4-4EF1-BABC-8F6B83587D9C} = {470FA32D-9976-47CA-AD4F-EC414A18043F}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {2DACFE0A-F699-4F73-BDBA-9FC86ADB358A}
EndGlobalSection
EndGlobal
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Both NuGet and Umbraco packages are available.
|NuGet Packages |Version |
|:-----------------|:-----------------|
|**Release**|[![NuGet download](http://img.shields.io/nuget/v/Our.Umbraco.HealthCheckSlackNotificationMethod.svg)](https://www.nuget.org/packages/Our.Umbraco.HealthCheckSlackNotificationMethod/)
|**Pre-release**|[![NuGet download](https://img.shields.io/myget/umbraco-packages/vpre/Our.Umbraco.HealthCheckSlackNotificationMethod.svg)](https://www.myget.org/feed/umbraco-packages/package/nuget/Our.Umbraco.HealthCheckSlackNotificationMethod/)

|Umbraco Packages | |
|:-----------------|:-----------------|
Expand Down
42 changes: 33 additions & 9 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,33 @@
os: Visual Studio 2017
version: 1.0.1.{build}

# Version format
version: 1.0.0.{build}
os: Visual Studio 2017

cache:
- packages -> **\packages.config # preserve "packages" directory in the root of build folder but will reset it if packages.config is modified
- packages -> src\**\packages.config # preserve "packages" directory in the root of build folder but will reset it if packages.config is modified

configuration: Release

branches:
only:
- develop
- master
- feature/buildRework

# UMBRACO_PACKAGE_PRERELEASE_SUFFIX if a rtm release build this should be blank, otherwise if empty will default to alpha
# example UMBRACO_PACKAGE_PRERELEASE_SUFFIX=beta
init:
- set UMBRACO_PACKAGE_PRERELEASE_SUFFIX=
environment:
# Version Suffix
version_suffix: alpha

install:
- ps: .\build\appveyor-semver.ps1
- ps: .\build\check-release-version.ps1
- ps: Update-AppveyorBuild -Version $Env:appveyor_version

assembly_info:
patch: true
file: 'src\Our.Umbraco.HCSlackNM**\AssemblyInfo.*'
assembly_version: '$(appveyor_file_version)'
assembly_file_version: '$(appveyor_file_version)'
assembly_informational_version: '$(mssemver)'

build_script:
- cmd: >-
Expand All @@ -24,4 +37,15 @@ build_script:
artifacts:
- path: artifacts\*.nupkg
- path: artifacts\*.zip
- path: artifacts\*.zip

deploy:
# Umbraco MyGet community feed
- provider: NuGet
server: https://www.myget.org/F/umbraco-packages/api/v2/package
symbol_server: https://www.myget.org/F/umbraco-packages/symbols/api/v2/package
api_key:
secure: SASQGWG/4zNns7bwSSsJ5RPvKcKfJsBeEPuw69wsVPA3PO739QmzVtc5VwQwgvbr
artifact: /.*\.nupkg/
on:
branch: develop
4 changes: 2 additions & 2 deletions build-appveyor.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ IF NOT EXIST "%toolsFolder%" (

IF NOT EXIST "%toolsFolder%vswhere.exe" (
ECHO vswhere not found - fetching now
nuget install vswhere -Version 2.0.2 -Source nuget.org -OutputDirectory tools
nuget install vswhere -Version 2.2.11 -Source nuget.org -OutputDirectory tools
)

FOR /f "delims=" %%A in ('dir "%toolsFolder%vswhere.*" /b') DO SET "vswhereExePath=%toolsFolder%%%A\"
MOVE "%vswhereExePath%tools\vswhere.exe" "%toolsFolder%vswhere.exe"

for /f "usebackq tokens=1* delims=: " %%i in (`"%CD%\tools\vswhere.exe" -latest -requires Microsoft.Component.MSBuild`) do (
if /i "%%i"=="installationPath" set InstallDir=%%j
if /i "%%i"=="installationPath" set InstallDir=%%j
)

SET VSWherePath="%InstallDir%\MSBuild"
Expand Down
2 changes: 1 addition & 1 deletion build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ECHO off

SET /P APPVEYOR_BUILD_NUMBER=Please enter a build number (e.g. 134):
SET /P PACKAGE_VERISON=Please enter your package version (e.g. 1.0.5):
SET /P UMBRACO_PACKAGE_PRERELEASE_SUFFIX=Please enter your package release suffix or leave empty (e.g. beta):
SET /P version_suffix=Please enter your package release suffix or leave empty (e.g. beta):

SET /P APPVEYOR_REPO_TAG=If you want to simulate a GitHub tag for a release (e.g. true):

Expand Down
54 changes: 6 additions & 48 deletions build/HCSlackNM.proj
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@
<MSBuildCommunityTasksPath>$(MSBuildProjectDirectory)\tools\MSBuildCommunityTasks</MSBuildCommunityTasksPath>
<MSBuildUmbracoTasksPath>$(MSBuildProjectDirectory)\tools\MSBuildUmbracoTasks</MSBuildUmbracoTasksPath>
<MSBuildNugetTasksPath>$(MSBuildProjectDirectory)\tools\MSBuildNugetTasks</MSBuildNugetTasksPath>
<AppVeyorUmbracoPath>$(MSBuildProjectDirectory)\tools\AppVeyorUmbraco</AppVeyorUmbracoPath>
</PropertyGroup>

<Import Project="$(MSBuildCommunityTasksPath)\MSBuild.Community.Tasks.Targets" />
<Import Project="$(MSBuildUmbracoTasksPath)\MSBuild.Umbraco.Tasks.Targets" />
<Import Project="$(MSBuildNugetTasksPath)\MSBuild.NuGet.Tasks.Targets" />
<Import Project="$(AppVeyorUmbracoPath)\AppVeyorUmbraco.Targets" />

<!-- SHARED PROPERTIES -->
<PropertyGroup>
Expand Down Expand Up @@ -42,35 +40,10 @@
<PropertyGroup>
<FileVersion>$(APPVEYOR_BUILD_VERSION)</FileVersion>
</PropertyGroup>
<Choose>
<When Condition="$(APPVEYOR_BUILD_NUMBER) != '' And $(APPVEYOR_REPO_TAG) != 'true' ">
<PropertyGroup>
<Release>false</Release>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<Release>true</Release>
</PropertyGroup>
</Otherwise>
</Choose>

<Choose>
<When Condition="$(Release) == 'false' And $(UMBRACO_PACKAGE_PRERELEASE_SUFFIX) == 'rtm'">
<PropertyGroup>
<AbortBuild>true</AbortBuild>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<AbortBuild>false</AbortBuild>
</PropertyGroup>
</Otherwise>
</Choose>

<!-- PATHS -->
<PropertyGroup>
<BuildConfig>Release</BuildConfig>
<BuildConfig>$(CONFIGURATION)</BuildConfig>
<RootDir>$(MSBuildProjectDirectory)\..</RootDir>
<BuildDir>$(MSBuildProjectDirectory)\_temp</BuildDir>
<BuildUmbDir>$(BuildDir)\_umbraco</BuildUmbDir>
Expand All @@ -81,16 +54,8 @@

</PropertyGroup>

<!-- TARGETS -->
<Target Name="GetProductVersion">
<Error Condition="$(AbortBuild) == 'true'" Text="Aborting the build as the UMBRACO_PACKAGE_PRERELEASE_SUFFIX suffix is set 'rtm' but APPVEYOR_REPO_TAG is not 'true'" />
<GetProductVersion BuildVersion="$(APPVEYOR_BUILD_VERSION)" BuildSuffix="$(UMBRACO_PACKAGE_PRERELEASE_SUFFIX)" Release="$(Release)">
<Output TaskParameter="ProductVersion" PropertyName="ProductVersion"/>
</GetProductVersion>
</Target>

<!-- CLEAN -->
<Target Name="Clean" DependsOnTargets="GetProductVersion">
<Target Name="Clean">
<RemoveDir Directories="$(BuildDir)" Condition="Exists('$(BuildDir)')" />
<RemoveDir Directories="$(ArtifactsDir)" Condition="Exists('$(ArtifactsDir)')" />
<MakeDir Directories="$(BuildDir)" />
Expand All @@ -99,15 +64,8 @@
<MakeDir Directories="$(ArtifactsDir)" />
</Target>

<!-- UPDATE PROJECT ASSEMBLEY VERSION -->
<Target Name="UpdateAssemblyInfo" DependsOnTargets="Clean">
<FileUpdate Encoding="ASCII" Files="$(CoreProjectDir)\Properties\VersionInfo.cs" Regex="AssemblyVersion\(&quot;.*&quot;\)\]" ReplacementText="AssemblyVersion(&quot;$(FileVersion)&quot;)]" />
<FileUpdate Encoding="ASCII" Files="$(CoreProjectDir)\Properties\VersionInfo.cs" Regex="AssemblyFileVersion\(&quot;.*&quot;\)\]" ReplacementText="AssemblyFileVersion(&quot;$(FileVersion)&quot;)]" />
<FileUpdate Encoding="ASCII" Files="$(CoreProjectDir)\Properties\VersionInfo.cs" Regex="AssemblyInformationalVersion\(&quot;.*&quot;\)\]" ReplacementText="AssemblyInformationalVersion(&quot;$(ProductVersion)&quot;)]" />
</Target>

<!-- COMPILE -->
<Target Name="Compile" DependsOnTargets="UpdateAssemblyInfo">
<Target Name="Compile" DependsOnTargets="Clean">
<MSBuild Projects="$(CoreProjectDir)\Our.Umbraco.HCSlackNM.csproj" Properties="Configuration=$(BuildConfig)" />
<MSBuild Projects="$(InstallerProjectDir)\Our.Umbraco.HCSlackNM.Installer.csproj" Properties="Configuration=$(BuildConfig)" />

Expand Down Expand Up @@ -164,7 +122,7 @@
WorkingDirectory="$(BuildUmbDir)"
MinimumRequiredUmbracoVersion="$(MinUmbracoVersion)"
PackageName="$(PackageName)"
PackageVersion="$(ProductVersion)"
PackageVersion="$(mssemver)"
AuthorName="$(AuthorName)"
AuthorUrl="$(AuthorUrl)"
Readme="$(Readme)"
Expand All @@ -186,7 +144,7 @@
Title="$(PackageName)"
Description="$(Description)"
Summary="$(Readme)"
Version="$(ProductVersion)"
Version="$(mssemver)"
MinimumRequiredUmbracoVersion ="$(MinUmbracoVersion)"
Authors="$(AuthorName)"
Owners="$(Owners)"
Expand Down Expand Up @@ -215,7 +173,7 @@
<MSBuild.NuGet.Tasks.Pack NuGetExePath="NuGet.exe"
ManifestFile="$(BuildNuGetDir)\package.nuspec"
BasePath="$(BuildNuGetDir)"
Version="$(ProductVersion)"
Version="$(mssemver)"
OutputDirectory="$(ArtifactsDir)"
Symbols="true" />

Expand Down
24 changes: 24 additions & 0 deletions build/appveyor-semver.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
$version=[Version]$Env:APPVEYOR_BUILD_VERSION
$version_suffix=$Env:version_suffix

$basever=$version.Major.ToString() + "." + $version.Minor.ToString() + "." + $version.Build.ToString()

$paddedRevision = $version.Revision.ToString().PadLeft(6,"0")

$semver = $basever + "-" + $version_suffix + "." + $version.Revision.ToString()
$mssemver = $basever + "-" + $version_suffix + "-" + $paddedRevision
$appveyor_version = $mssemver

$Env:semver = $semver
$Env:mssemver = $mssemver
$Env:appveyor_version = $appveyor_version

$Env:appveyor_file_version = $Env:APPVEYOR_BUILD_VERSION

$Env:ms_file_version = $version.ToString()
$Env:padded_build_revision = $paddedRevision

"Envrionment variable 'semver' set:" + $Env:semver
"Envrionment variable 'mssemver' set:" + $Env:mssemver
"Envrionment variable 'appveyor_version' set:" + $Env:appveyor_version
"Envrionment variable 'padded_build_revision' set:" + $Env:padded_build_revision
57 changes: 57 additions & 0 deletions build/check-release-version.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
$tagged=$Env:APPVEYOR_REPO_TAG
$tag_name=$Env:APPVEYOR_REPO_TAG_NAME
$version=[Version]$Env:APPVEYOR_BUILD_VERSION
$branch=$Env:APPVEYOR_REPO_BRANCH

$Env:tagged_release_build = "false"

#$tagged="true"
#$tag_name="v2.1.2-beta"
#$version=[Version]"2.1.2.12"

$has_suffix = "false"
$suffix = ""

"APPVEYOR_REPO_TAG:" + $tagged
"APPVEYOR_REPO_TAG_NAME:" + $tag_name

If ($tagged -eq "true" -and $tag_name.StartsWith("v") -and $branch -eq "master"){

# This is to cut out the beta etc
if ($tag_name.Contains("-")){
$has_suffix = "true"
$index = $tag_name.indexof("-");
$suffix = $tag_name.Substring($index + 1, $tag_name.Length - ($index + 1))
$tag_name = $tag_name.Substring(0, $index)
}

$tagged_version=[Version]$tag_name.Substring(1)

if ($tagged_version.Major -eq $version.Major -and $tagged_version.Minor -eq $version.Minor -and $tagged_version.Build -eq $version.Build){
"** THIS IS A TAGGED RELEASE BUILD:" + $tagged_version.ToString() + " **"

$Env:tagged_release_build = "true"

$basever=$tagged_version.Major.ToString() + "." + $tagged_version.Minor.ToString() + "." + $tagged_version.Build.ToString()

if ($has_suffix -eq "true"){
$Env:version_suffix = $suffix

$Env:mssemver = $basever + "-" + $suffix
$Env:appveyor_version = $basever + "-" + $suffix
$Env:semver = $basever + "-" + $suffix
} Else {
$Env:mssemver = $basever
$Env:appveyor_version = $basever
$Env:semver = $basever
}

"Envrionment variable 'semver' set:" + $Env:semver
"Envrionment variable 'mssemver' set:" + $Env:mssemver
"Envrionment variable 'appveyor_version' set:" + $Env:appveyor_version
}Else{
"** Naughty, naughty, very naughty, tagged version: " + $tagged_version.ToString() + " doesn't match build version:" + $version.ToString() + " **"
"** If this was intentional you should manually bump the version in appveyor.yml **"
$host.SetShouldExit(1)
}
}
2 changes: 1 addition & 1 deletion build/package.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<tags></tags>
<dependencies>
<dependency id="UmbracoCms.Core" version="0.0.0" />
<dependency id="Slack.Webhooks" version="0.1.7" />
<dependency id="Slack.Webhooks" version="0.1.8" />
</dependencies>
</metadata>
</package>
49 changes: 0 additions & 49 deletions build/tools/AppVeyorUmbraco/AppVeyorUmbraco.Targets

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("0.0.1.1")]
[assembly: AssemblyFileVersion("0.0.1.1")]
[assembly: AssemblyInformationalVersion("0.0.1.1-alpha-000001")]
Loading

0 comments on commit 35f5cf6

Please sign in to comment.