Skip to content
This repository was archived by the owner on Jul 20, 2023. It is now read-only.

Commit 5d584e3

Browse files
authored
Buildupdate
!Deploy * updated appveyor.yml * updates psdeploy to not use unused option with appveyor publish * added github release * updated manifest release notes
1 parent 6509b59 commit 5d584e3

File tree

5 files changed

+49
-8
lines changed

5 files changed

+49
-8
lines changed

.build/Appveyor/TestResultUpload.Appveyor.build.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ task Upload_Unit_Test_Results_To_CodeCov -If {(property BuildSystem 'unknown') -
3333

3434
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
3535
$ProgressPreference = 'SilentlyContinue'
36-
Invoke-WebRequest -UseBasicParsing -Uri 'https://github.com/codecov/codecov-exe/releases/download/1.0.4/Codecov.zip' -OutFile .\Codecov.zip
36+
Invoke-WebRequest -UseBasicParsing -Uri 'https://github.com/codecov/codecov-exe/releases/download/1.1.0/Codecov.zip' -OutFile .\Codecov.zip
3737
$ProgressPreference = 'Continue'
3838
Unblock-File -Path .\Codecov.zip
3939
Expand-Archive -Path .\Codecov.zip -DestinationPath .\codecov
4040

4141
Write-Build Green " Uploading test results [$($TestResultFiles.Name -join ', ')] to CodeCov"
4242

43-
.\codecov\codecov.exe -f $TestResultFiles.FullName
43+
.\codecov\codecov.exe -f $TestResultFiles.FullName --root $BuildRoot
4444
}
4545

DSCPullServerAdmin/DSCPullServerAdmin.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ PrivateData = @{
126126
# IconUri = ''
127127

128128
# ReleaseNotes of this module
129-
ReleaseNotes = 'SQL Query updates for Get-DSCPullServerAdminStatusReport. Increased ConfirmImpact to High for Set functions'
129+
ReleaseNotes = 'No changes, build pipeline update to create GitHub releases togheter with PSGallery Publishing'
130130

131131
} # End of PSData hashtable
132132

Deploy.PSDeploy.ps1

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
if (
22
$env:ProjectName -and $ENV:ProjectName.Count -eq 1 -and
33
$env:BuildSystem -eq 'AppVeyor'
4-
)
5-
{
4+
) {
65

7-
Write-Host "PR: $Env:APPVEYOR_PULL_REQUEST_NUMBER"
86
if (!$Env:APPVEYOR_PULL_REQUEST_NUMBER -and
97
$Env:BuildSystem -eq 'AppVeyor' -and
108
$Env:BranchName -eq 'master' -and
119
$Env:NuGetApiKey -and
10+
$Env:GitHubKey -and
1211
$Env:CommitMessage -match '!Deploy'
1312
) {
1413
$manifest = Import-PowerShellDataFile -Path ".\$Env:ProjectName\$Env:ProjectName.psd1"
@@ -33,6 +32,43 @@ if (
3332
}
3433
}
3534
}
35+
36+
#TODO: Replace with PSDeploy Script
37+
Write-Host "Creating GitHub release" -ForegroundColor Green
38+
$updatedManifest = Import-PowerShellDataFile .\BuildOutput\$Env:ProjectName\$Env:ProjectName.psd1
39+
40+
$releaseData = @{
41+
tag_name = '{0}' -f $updatedManifest.ModuleVersion
42+
target_commitish = $ENV:APPVEYOR_REPO_COMMIT
43+
name = '{0}' -f $updatedManifest.ModuleVersion
44+
body = $updatedManifest.PrivateData.PSData.ReleaseNotes
45+
draft = $false
46+
prerelease = $false
47+
}
48+
49+
$releaseParams = @{
50+
Uri = "https://api.github.com/repos/$ENV:APPVEYOR_REPO_NAME/releases?access_token=$Env:GitHubKey"
51+
Method = 'POST'
52+
ContentType = 'application/json'
53+
Body = (ConvertTo-Json $releaseData -Compress)
54+
UseBasicParsing = $true
55+
}
56+
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
57+
$newRelease = Invoke-RestMethod @releaseParams
58+
59+
Compress-Archive -DestinationPath ".\BuildOutput\DSCPullServerAdmin_$($updatedManifest.ModuleVersion).zip" -Path .\BuildOutput\$Env:ProjectName\*.*
60+
61+
$uploadParams = @{
62+
Uri = ($newRelease.upload_url -replace '\{\?name.*\}', '?name=DSCPullServerAdmin_') +
63+
$updatedManifest.ModuleVersion +
64+
'.zip&access_token=' +
65+
$Env:GitHubKey
66+
Method = 'POST'
67+
ContentType = 'application/zip'
68+
InFile = ".\BuildOutput\DSCPullServerAdmin_$($updatedManifest.ModuleVersion).zip"
69+
}
70+
71+
$null = Invoke-RestMethod @uploadParams
3672
}
3773

3874
Deploy AppveyorDeployment {
@@ -45,7 +81,6 @@ if (
4581
Description = 'Get data from your DSC Pull Server database'
4682
Author = "Ben Gelens"
4783
Owners = "Ben Gelens"
48-
destinationPath = ".\BuildOutput\$Env:ProjectName"
4984
}
5085
Tagged Appveyor
5186
}

appveyor.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11

22
os: WMF 5
33

4-
build: false
4+
clone_folder: c:\projects\DSCPullServerAdmin
5+
6+
skip_tags: true
7+
8+
build: off
59

610
build_script:
711
- ps: . .\.build.ps1 -ResolveDependency
812

913
environment:
1014
NuGetApiKey:
1115
secure: lwF9LdoE9z5NFxxZB0yh6g0Ly4gFWfRwftRLqCRNuSdRXjpi10uvRynwm4A2tiI7
16+
GitHubKey:
17+
secure: 6b8uwr5ASsUbWr7dbRJ7ARufTglPEwAwJA28BuPWComAUphpixxzyJmhP4ctoj9F
File renamed without changes.

0 commit comments

Comments
 (0)