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

Commit

Permalink
Buildupdate
Browse files Browse the repository at this point in the history
!Deploy
* updated appveyor.yml
* updates psdeploy to not use unused option with appveyor publish
* added github release
* updated manifest release notes
  • Loading branch information
bgelens authored Oct 28, 2018
1 parent 6509b59 commit 5d584e3
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .build/Appveyor/TestResultUpload.Appveyor.build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ task Upload_Unit_Test_Results_To_CodeCov -If {(property BuildSystem 'unknown') -

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

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

.\codecov\codecov.exe -f $TestResultFiles.FullName
.\codecov\codecov.exe -f $TestResultFiles.FullName --root $BuildRoot
}

2 changes: 1 addition & 1 deletion DSCPullServerAdmin/DSCPullServerAdmin.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ PrivateData = @{
# IconUri = ''

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

} # End of PSData hashtable

Expand Down
43 changes: 39 additions & 4 deletions Deploy.PSDeploy.ps1
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
if (
$env:ProjectName -and $ENV:ProjectName.Count -eq 1 -and
$env:BuildSystem -eq 'AppVeyor'
)
{
) {

Write-Host "PR: $Env:APPVEYOR_PULL_REQUEST_NUMBER"
if (!$Env:APPVEYOR_PULL_REQUEST_NUMBER -and
$Env:BuildSystem -eq 'AppVeyor' -and
$Env:BranchName -eq 'master' -and
$Env:NuGetApiKey -and
$Env:GitHubKey -and
$Env:CommitMessage -match '!Deploy'
) {
$manifest = Import-PowerShellDataFile -Path ".\$Env:ProjectName\$Env:ProjectName.psd1"
Expand All @@ -33,6 +32,43 @@ if (
}
}
}

#TODO: Replace with PSDeploy Script
Write-Host "Creating GitHub release" -ForegroundColor Green
$updatedManifest = Import-PowerShellDataFile .\BuildOutput\$Env:ProjectName\$Env:ProjectName.psd1

$releaseData = @{
tag_name = '{0}' -f $updatedManifest.ModuleVersion
target_commitish = $ENV:APPVEYOR_REPO_COMMIT
name = '{0}' -f $updatedManifest.ModuleVersion
body = $updatedManifest.PrivateData.PSData.ReleaseNotes
draft = $false
prerelease = $false
}

$releaseParams = @{
Uri = "https://api.github.com/repos/$ENV:APPVEYOR_REPO_NAME/releases?access_token=$Env:GitHubKey"
Method = 'POST'
ContentType = 'application/json'
Body = (ConvertTo-Json $releaseData -Compress)
UseBasicParsing = $true
}
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$newRelease = Invoke-RestMethod @releaseParams

Compress-Archive -DestinationPath ".\BuildOutput\DSCPullServerAdmin_$($updatedManifest.ModuleVersion).zip" -Path .\BuildOutput\$Env:ProjectName\*.*

$uploadParams = @{
Uri = ($newRelease.upload_url -replace '\{\?name.*\}', '?name=DSCPullServerAdmin_') +
$updatedManifest.ModuleVersion +
'.zip&access_token=' +
$Env:GitHubKey
Method = 'POST'
ContentType = 'application/zip'
InFile = ".\BuildOutput\DSCPullServerAdmin_$($updatedManifest.ModuleVersion).zip"
}

$null = Invoke-RestMethod @uploadParams
}

Deploy AppveyorDeployment {
Expand All @@ -45,7 +81,6 @@ if (
Description = 'Get data from your DSC Pull Server database'
Author = "Ben Gelens"
Owners = "Ben Gelens"
destinationPath = ".\BuildOutput\$Env:ProjectName"
}
Tagged Appveyor
}
Expand Down
8 changes: 7 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@

os: WMF 5

build: false
clone_folder: c:\projects\DSCPullServerAdmin

skip_tags: true

build: off

build_script:
- ps: . .\.build.ps1 -ResolveDependency

environment:
NuGetApiKey:
secure: lwF9LdoE9z5NFxxZB0yh6g0Ly4gFWfRwftRLqCRNuSdRXjpi10uvRynwm4A2tiI7
GitHubKey:
secure: 6b8uwr5ASsUbWr7dbRJ7ARufTglPEwAwJA28BuPWComAUphpixxzyJmhP4ctoj9F
File renamed without changes.

0 comments on commit 5d584e3

Please sign in to comment.