Skip to content

Commit 585e627

Browse files
committed
Updates for correct release
* Removed support for pushing docs from scripts - That's now a distinct GH action step as things have changed in the back-end on how that works. * Renamed docs script to `Commit-Docs.ps1` as it now ONLY supports commit. * Updated release action to reflect changes to docs commit/publish
1 parent 25f170c commit 585e627

File tree

3 files changed

+8
-53
lines changed

3 files changed

+8
-53
lines changed

.github/workflows/release-build.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,9 @@ jobs:
5454
run: ./Build-Docs.ps1
5555

5656
- name: Commit Docs
57-
env:
58-
docspush_email: 32618965+cibuild-telliam@users.noreply.github.com
59-
docspush_username: cibuild-telliam
60-
run: .\Push-Docs.ps1 -SkipPush
57+
run: .\Commit-Docs.ps1
6158

62-
- name: Push Docs
59+
- name: Publish Docs
6360
uses: ad-m/github-push-action@master
6461
with:
6562
github_token: ${{ secrets.GITHUB_TOKEN }}
@@ -73,6 +70,4 @@ jobs:
7370
if: (!cancelled())
7471
uses: softprops/action-gh-release@v2
7572
with:
76-
tag_name: ${{ github.ref }}
77-
release_name: Release ${{ github.ref }}
7873
draft: true

Push-Docs.ps1 renamed to Commit-Docs.ps1

Lines changed: 5 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -16,57 +16,23 @@ using module "PSModules/RepoBuild/RepoBuild.psd1"
1616
This is used by automated release builds to essentially "commit" the doc changes before a dedicated step pushes the results.
1717
#>
1818
Param(
19-
[switch]$FullInit,
20-
[switch]$SkipPush
19+
[switch]$FullInit
2120
)
2221

2322
$buildInfo = Initialize-BuildEnvironment -FullInit:$FullInit
2423

25-
Write-Information "Preparing to PUSH updated docs to GitHub IO"
24+
Write-Information "Preparing to commit updated docs for gh-pages"
2625

27-
$canPush = $env:IsAutomatedBuild -and ($env:IsPullRequestBuild -ieq 'false')
28-
if(!$canPush)
26+
$canCommit = $env:IsAutomatedBuild -and ($env:IsPullRequestBuild -ieq 'false')
27+
if(!$canCommit)
2928
{
30-
Write-Information "Skipping Docs PUSH as this is not an official build"
29+
Write-Information "Skipping Docs commit as this is not an official build"
3130
return;
3231
}
3332

34-
# Docs must only be updated from a build with the official repository as the default remote.
35-
# This ensures that the links to source in the generated docs will have the correct URLs
36-
# (e.g. docs pushed to the official repository MUST not have links to source in some private fork)
37-
$remoteUrl = Invoke-External git ls-remote --get-url
38-
39-
Write-Information "Remote URL: $remoteUrl"
40-
41-
if($remoteUrl -ne $buildInfo['OfficialGitRemoteUrl'])
42-
{
43-
throw "Pushing docs is only allowed when the origin remote is the official source - current remote is '$remoteUrl'"
44-
}
45-
46-
if(!$env:docspush_access_token -and !$SkipPush)
47-
{
48-
Write-Error "Missing docspush_access_token" -ErrorAction Stop
49-
}
50-
51-
if(!$env:docspush_email)
52-
{
53-
Write-Error "Missing docspush_email" -ErrorAction Stop
54-
}
55-
56-
if(!$env:docspush_username)
57-
{
58-
Write-Error "Missing docspush_username" -ErrorAction Stop
59-
}
60-
6133
Push-Location .\BuildOutput\docs -ErrorAction Stop
6234
try
6335
{
64-
if($env:docspush_access_token)
65-
{
66-
Invoke-External git config --local credential.helper store
67-
Add-Content "$env:USERPROFILE\.git-credentials" "https://$($env:docspush_access_token):x-oauth-basic@github.com`n"
68-
}
69-
7036
Invoke-External git config --local user.email "$env:docspush_email"
7137
Invoke-External git config --local user.name "$env:docspush_username"
7238

@@ -84,12 +50,6 @@ try
8450
$msg = "CI Docs Update $(Get-BuildVersionTag $buildInfo)"
8551
Write-Information "Committing changes to git [$msg]"
8652
Invoke-External git commit -m"$msg"
87-
88-
if(!$SkipPush)
89-
{
90-
Write-Information 'Pushing changes to git'
91-
Invoke-External git push
92-
}
9353
}
9454
catch
9555
{

src/Ubiquity.NET.Versioning.slnx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<File Path="../Build-All.ps1" />
77
<File Path="../Build-Docs.ps1" />
88
<File Path="../BuildVersion.xml" />
9+
<File Path="../Commit-Docs.ps1" />
910
<File Path="../Directory.Build.props" />
1011
<File Path="../Directory.Build.targets" />
1112
<File Path="../Directory.Packages.props" />
@@ -14,7 +15,6 @@
1415
<File Path="../Invoke-Tests.ps1" />
1516
<File Path="../New-GeneratedVersionProps.ps1" />
1617
<File Path="../Nuget.Config" />
17-
<File Path="../Push-Docs.ps1" />
1818
<File Path="../Push-Nuget.ps1" />
1919
<File Path="../README.md" />
2020
<File Path="../Show-Docs.ps1" />

0 commit comments

Comments
 (0)