Skip to content

Commit 9ba6d59

Browse files
committed
updated nightly build
1 parent 16ecb6e commit 9ba6d59

File tree

2 files changed

+26
-15
lines changed

2 files changed

+26
-15
lines changed

build/Build-Nightly.ps1

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
$runPublish = $false
22

3+
$dependencies = Invoke-RestMethod -Method Get -Uri https://raw.githubusercontent.com/pnp/powershell/dev/dependencies.json
4+
35
$pnppowershell_hash = git ls-files -s ./src | git hash-object --stdin
4-
$existing_pnppowershell_hash = Get-Content ./pnppowershell_hash.txt -Raw -ErrorAction SilentlyContinue
6+
#$existing_pnppowershell_hash = Get-Content ./pnppowershell_hash.txt -Raw -ErrorAction SilentlyContinue
57

6-
$existing_pnpframework_hash = Get-Content ./pnpframework_hash.txt -Raw -ErrorAction SilentlyContinue
8+
#$existing_pnpframework_hash = Get-Content ./pnpframework_hash.txt -Raw -ErrorAction SilentlyContinue
79
$pnpframework_response = Invoke-RestMethod -Method Get -Uri "$($env:GITHUB_API_URL)/repos/pnp/pnpframework/branches/dev" -SkipHttpErrorCheck
810
if ($null -ne $pnpframework_response) {
911
if ($null -ne $pnpframework_response.commit) {
1012
$pnpframework_hash = $pnpframework_response.commit.sha
1113
}
1214
}
1315

14-
$existing_pnpcoresdk_hash = Get-Content ./pnpcoresdk_hash.txt -Raw -ErrorAction SilentlyContinue
16+
#$existing_pnpcoresdk_hash = Get-Content ./pnpcoresdk_hash.txt -Raw -ErrorAction SilentlyContinue
1517
$pnpcoresdk_response = Invoke-RestMethod -Method Get -Uri "$($env:GITHUB_API_URL)/repos/pnp/pnpcore/branches/dev" -SkipHttpErrorCheck
1618
if ($null -ne $pnpcoresdk_response) {
1719
if ($null -ne $pnpcoresdk_response.commit) {
@@ -24,34 +26,37 @@ if ($null -ne $pnpcoresdk_response) {
2426
#Write-host "Latest PnP Framework Commit hash $pnpframework_hash" -ForegroundColor Yellow
2527
#Write-Host "Stored PnP Framework Commit hash: $existing_pnpframework_hash" -ForegroundColor Yellow
2628

27-
if ($existing_pnppowershell_hash -ne $pnppowershell_hash) {
28-
Write-Host "PnP PowerShell is newer"
29-
Set-Content ./pnppowershell_hash.txt -Value $pnppowershell_hash -NoNewline -Force
29+
if ($dependencies.PnPPowershell -ne $pnppowershell_hash) {
30+
Write-Host "PnP Powershell is newer"
31+
$dependencies.PnPPowershell = $pnppowershell_hash
3032
$runPublish = $true
3133
}
3234

33-
if ($runPublish -eq $false -and $existing_pnpframework_hash -ne $pnpframework_hash) {
35+
if ($runPublish -eq $false -and $dependencies.PnPFramework -ne $pnpframework_hash) {
3436
Write-Host "PnP Framework is newer"
35-
Set-Content ./pnpframework_hash.txt -Value $pnpframework_hash -NoNewline -Force
37+
$dependencies.PnPFramework = $pnppowershell_hash
3638
$runPublish = $true
3739
}
3840

39-
if ($runPublish -eq $false -and $existing_pnpcoresdk_hash -ne $pnpcoresdk_hash) {
41+
if ($runPublish -eq $false -and $dependencies.PnPCore -ne $pnpcoresdk_hash) {
4042
Write-Host "PnP Core SDK is newer"
41-
Set-Content ./pnpcoresdk_hash.txt -Value $pnpcoresdk_hash -NoNewLine -Force
43+
$dependencies.PnPCore = $pnpcoresdk_hash
4244
$runPublish = $true
4345
}
4446

4547
if ($runPublish -eq $true) {
48+
$dependencies.Updated = Get-Date -Format "yyyyMMdd-HHmmss"
49+
Set-Content ./dependencies.json -Value $(ConvertTo-Json $dependencies) -Force
50+
51+
$versionFileContents = Get-Content "$PSScriptRoot/../version.json" -Raw | ConvertFrom-Json
4652

47-
$versionFileContents = (Get-Content "$PSScriptRoot/../version.txt" -Raw).Trim()
48-
if ($versionFileContents.Contains("%")) {
49-
$versionString = $versionFileContents.Replace("%", "0");
53+
if ($versionFileContents.Version.Contains("%")) {
54+
$versionString = $versionFileContents.Version.Replace("%", "0");
5055
$versionObject = [System.Management.Automation.SemanticVersion]::Parse($versionString)
5156
$buildVersion = $versionObject.Patch;
5257
}
5358
else {
54-
$versionObject = [System.Management.Automation.SemanticVersion]::Parse($versionFileContents)
59+
$versionObject = [System.Management.Automation.SemanticVersion]::Parse($versionFileContents.Version)
5560
$buildVersion = $versionObject.Patch + 1;
5661
}
5762

@@ -201,6 +206,6 @@ if ($runPublish -eq $true) {
201206
Set-Content ./version.txt -Value $version -Force -NoNewline
202207

203208
# Write version back to version.json
204-
$json = @{Version="$version";Message=""} | ConvertTo-Json
209+
$json = @{Version = "$version"; Message = "" } | ConvertTo-Json
205210
Set-Content ./version.json -Value $json -Force -NoNewline
206211
}

dependencies.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"Updated" : "20241122-152813",
3+
"PnPPowerShell": "",
4+
"PnPFramework": "",
5+
"PnPCore": ""
6+
}

0 commit comments

Comments
 (0)