Skip to content

Commit 46fac94

Browse files
committed
Configuration and changes to support develop prerelase builds
1 parent 8e143f7 commit 46fac94

File tree

3 files changed

+36
-9
lines changed

3 files changed

+36
-9
lines changed

UnitySetup/UnitySetup.psd1

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#
66
# Generated by: Josh Wittner
77
#
8-
# Generated on: 2017-08-04
8+
# Generated on: 2018-01-31
99
#
1010

1111
@{
@@ -119,6 +119,12 @@ PrivateData = @{
119119
# ReleaseNotes of this module
120120
# ReleaseNotes = ''
121121

122+
# Prerelease string of this module
123+
# Prerelease = ''
124+
125+
# Flag to indicate whether the module requires explicit user acceptance for install/update
126+
# RequireLicenseAcceptance = $false
127+
122128
# External dependent modules of this module
123129
# ExternalModuleDependencies = @()
124130

appveyor.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ pull_requests:
44
branches:
55
only:
66
- master
7+
- develop
78
environment:
89
NugetAPIKey:
910
secure: zvkaZiaBXVko+3ZzuSb7W6DTUJmHX98XgEhKs28SnGD+4TM3gzhPxVnNWSmBhXEx
@@ -13,6 +14,14 @@ install:
1314
1415
Install-Module 'powershell-yaml' -Scope CurrentUser -Force -AllowClobber
1516
build_script:
16-
- ps: .\build.ps1 -Revision "$env:APPVEYOR_BUILD_NUMBER"
17+
- ps: .\build.ps1 -Revision "$env:APPVEYOR_BUILD_NUMBER" -Suffix "$env:APPVEYOR_REPO_BRANCH"
1718
deploy_script:
18-
- ps: Publish-Module -Path .\UnitySetup -NugetAPIKey $env:NugetAPIKey
19+
- ps: Publish-Module -Path .\UnitySetup -NugetAPIKey $env:NugetAPIKey
20+
for:
21+
-
22+
branches:
23+
only:
24+
- master
25+
build_script:
26+
- ps: .\build.ps1 -Revision "$env:APPVEYOR_BUILD_NUMBER"
27+

build.ps1

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
1-
param([int]$Revision = 0)
2-
$currentVersion = Test-ModuleManifest -ErrorAction Stop .\UnitySetup\UnitySetup.psd1 | Select-Object -ExpandProperty Version
3-
Write-Host "Current Module Version: $currentVersion"
4-
$newVersion = New-Object System.Version($currentVersion.Major, $currentVersion.Minor, $Revision)
1+
param([int]$Revision = 0, [string]$Suffix = '')
2+
$ErrorActionPreference = 'Stop'
53

6-
Write-Host "New Module Version:$newVersion"
7-
Update-ModuleManifest -ErrorAction Stop -ModuleVersion $newVersion -Path .\UnitySetup\UnitySetup.psd1
4+
$manifest = Test-ModuleManifest .\UnitySetup\UnitySetup.psd1
5+
$versionString = $manifest.Version.ToString()
6+
if($manifest.PrivateData['PSData']['Prerelease']) {
7+
$versionString += "-$($manifest.PrivateData['PSData']['Prerelease'])"
8+
}
9+
Write-Host "Current Module Version: $versionString"
10+
11+
$newVersion = New-Object System.Version($manifest.Version.Major, $manifest.Version.Minor, $Revision)
12+
Update-ModuleManifest -ModuleVersion $newVersion -Prerelease $Suffix -Path .\UnitySetup\UnitySetup.psd1
13+
14+
$manifest = Test-ModuleManifest .\UnitySetup\UnitySetup.psd1
15+
$versionString = $manifest.Version.ToString()
16+
if($manifest.PrivateData['PSData']['Prerelease']) {
17+
$versionString += "-$($manifest.PrivateData['PSData']['Prerelease'])"
18+
}
19+
Write-Host "New Module Version: $versionString"

0 commit comments

Comments
 (0)