Skip to content

Commit 00ffbe5

Browse files
Merge pull request #201 from StartAutomating/HelpOut-Docker
Help out docker
2 parents 45ff665 + ad32843 commit 00ffbe5

36 files changed

+893
-139
lines changed

.github/workflows/TestReleaseAndPublish.yml

Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ jobs:
116116
Install-Module -Name Pester -Repository PSGallery -Force -Scope CurrentUser -MaximumVersion $PesterMaxVersion -SkipPublisherCheck -AllowClobber
117117
Import-Module Pester -Force -PassThru -MaximumVersion $PesterMaxVersion} @Parameters
118118
- name: Check out repository
119-
uses: actions/checkout@v2
119+
uses: actions/checkout@v4
120120
- name: RunPester
121121
id: RunPester
122122
shell: pwsh
@@ -173,9 +173,6 @@ jobs:
173173
$result =
174174
Invoke-Pester -PassThru -Verbose -OutputFile ".\$moduleName.TestResults.xml" -OutputFormat NUnitXml @codeCoverageParameters
175175
176-
"::set-output name=TotalCount::$($result.TotalCount)",
177-
"::set-output name=PassedCount::$($result.PassedCount)",
178-
"::set-output name=FailedCount::$($result.FailedCount)" | Out-Host
179176
if ($result.FailedCount -gt 0) {
180177
"::debug:: $($result.FailedCount) tests failed"
181178
foreach ($r in $result.TestResult) {
@@ -187,7 +184,7 @@ jobs:
187184
}
188185
} @Parameters
189186
- name: PublishTestResults
190-
uses: actions/upload-artifact@v2
187+
uses: actions/upload-artifact@v3
191188
with:
192189
name: PesterResults
193190
path: '**.TestResults.xml'
@@ -593,6 +590,43 @@ jobs:
593590
- name: PSA
594591
uses: StartAutomating/PSA@main
595592
id: PSA
593+
- name: Log in to ghcr.io
594+
uses: docker/login-action@master
595+
with:
596+
registry: ${{ env.REGISTRY }}
597+
username: ${{ github.actor }}
598+
password: ${{ secrets.GITHUB_TOKEN }}
599+
- name: Extract Docker Metadata (for branch)
600+
if: ${{github.ref_name != 'main' && github.ref_name != 'master' && github.ref_name != 'latest'}}
601+
id: meta
602+
uses: docker/metadata-action@master
603+
with:
604+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
605+
- name: Extract Docker Metadata (for main)
606+
if: ${{github.ref_name == 'main' || github.ref_name == 'master' || github.ref_name == 'latest'}}
607+
id: metaMain
608+
uses: docker/metadata-action@master
609+
with:
610+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
611+
flavor: latest=true
612+
- name: Build and push Docker image (from main)
613+
if: ${{github.ref_name == 'main' || github.ref_name == 'master' || github.ref_name == 'latest'}}
614+
uses: docker/build-push-action@master
615+
with:
616+
context: .
617+
push: true
618+
tags: ${{ steps.metaMain.outputs.tags }}
619+
labels: ${{ steps.metaMain.outputs.labels }}
620+
- name: Build and push Docker image (from branch)
621+
if: ${{github.ref_name != 'main' && github.ref_name != 'master' && github.ref_name != 'latest'}}
622+
uses: docker/build-push-action@master
623+
with:
624+
context: .
625+
push: true
626+
tags: ${{ steps.meta.outputs.tags }}
627+
labels: ${{ steps.meta.outputs.labels }}
596628
env:
597-
AT_PROTOCOL_APP_PASSWORD: ${{ secrets.AT_PROTOCOL_APP_PASSWORD }}
598629
AT_PROTOCOL_HANDLE: mrpowershell.bsky.social
630+
AT_PROTOCOL_APP_PASSWORD: ${{ secrets.AT_PROTOCOL_APP_PASSWORD }}
631+
REGISTRY: ghcr.io
632+
IMAGE_NAME: ${{ github.repository }}
File renamed without changes.
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
@{
2+
"runs-on" = "ubuntu-latest"
3+
if = '${{ success() }}'
4+
steps = @(
5+
@{
6+
name = 'Check out repository'
7+
uses = 'actions/checkout@v2'
8+
},
9+
@{
10+
name = 'Use PSSVG Action'
11+
uses = 'StartAutomating/PSSVG@main'
12+
id = 'PSSVG'
13+
},
14+
'RunPipeScript',
15+
'RunEZOut',
16+
@{
17+
name = 'Run Help Out (on master)'
18+
if = '${{github.ref_name == ''master''}}'
19+
uses = 'StartAutomating/HelpOut@master'
20+
id = 'HelpOutMaster'
21+
},
22+
@{
23+
name = 'Run Help Out (on branch)'
24+
if = '${{github.ref_name != ''master''}}'
25+
uses = './'
26+
id = 'HelpOutBranch'
27+
},
28+
@{
29+
name = 'PSA'
30+
uses = 'StartAutomating/PSA@main'
31+
id = 'PSA'
32+
},
33+
@{
34+
'name'='Log in to ghcr.io'
35+
'uses'='docker/login-action@master'
36+
'with'=@{
37+
'registry'='${{ env.REGISTRY }}'
38+
'username'='${{ github.actor }}'
39+
'password'='${{ secrets.GITHUB_TOKEN }}'
40+
}
41+
},
42+
@{
43+
name = 'Extract Docker Metadata (for branch)'
44+
if = '${{github.ref_name != ''main'' && github.ref_name != ''master'' && github.ref_name != ''latest''}}'
45+
id = 'meta'
46+
uses = 'docker/metadata-action@master'
47+
with = @{
48+
'images'='${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}'
49+
}
50+
},
51+
@{
52+
name = 'Extract Docker Metadata (for main)'
53+
if = '${{github.ref_name == ''main'' || github.ref_name == ''master'' || github.ref_name == ''latest''}}'
54+
id = 'metaMain'
55+
uses = 'docker/metadata-action@master'
56+
with = @{
57+
'images'='${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}'
58+
'flavor'='latest=true'
59+
}
60+
},
61+
@{
62+
name = 'Build and push Docker image (from main)'
63+
if = '${{github.ref_name == ''main'' || github.ref_name == ''master'' || github.ref_name == ''latest''}}'
64+
uses = 'docker/build-push-action@master'
65+
with = @{
66+
'context'='.'
67+
'push'='true'
68+
'tags'='${{ steps.metaMain.outputs.tags }}'
69+
'labels'='${{ steps.metaMain.outputs.labels }}'
70+
}
71+
},
72+
@{
73+
name = 'Build and push Docker image (from branch)'
74+
if = '${{github.ref_name != ''main'' && github.ref_name != ''master'' && github.ref_name != ''latest''}}'
75+
uses = 'docker/build-push-action@master'
76+
with = @{
77+
'context'='.'
78+
'push'='true'
79+
'tags'='${{ steps.meta.outputs.tags }}'
80+
'labels'='${{ steps.meta.outputs.labels }}'
81+
}
82+
}
83+
)
84+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
@{
2+
name = 'PublishTestResults'
3+
uses = 'actions/upload-artifact@v3'
4+
with = @{
5+
name = 'PesterResults'
6+
path = '**.TestResults.xml'
7+
}
8+
if = '${{always()}}'
9+
}
10+
Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
#requires -Module PSDevOps
2-
#requires -Module HelpOut
3-
Import-BuildStep -ModuleName HelpOut
2+
Import-BuildStep -SourcePath (
3+
Join-Path $PSScriptRoot 'GitHub'
4+
) -BuildSystem GitHubAction
5+
6+
Push-Location ($PSScriptRoot | Split-Path)
7+
48
New-GitHubAction -Name "OutputHelp" -Description @'
59
Output Help for a PowerShell Module, using HelpOut
610
'@ -Action HelpOutAction -Icon help-circle -OutputPath .\action.yml
11+
12+
13+
Pop-Location

HelpOut.GitHubWorkflow.PSDevOps.ps1 renamed to Build/HelpOut.GitHubWorkflow.PSDevOps.ps1

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,24 @@
1-
#requires -Module HelpOut
2-
#requires -Module PSDevOps
1+
#requires -Module PSDevOps
32
#requires -Module GitPub
43
Push-Location $PSScriptRoot
54

65
Import-BuildStep -Module GitPub
76

8-
Import-BuildStep -Module HelpOut
7+
Import-BuildStep -SourcePath (
8+
Join-Path $PSScriptRoot 'GitHub'
9+
) -BuildSystem GitHubWorkflow
10+
11+
Push-Location ($PSScriptRoot | Split-Path)
912

1013
New-GitHubWorkflow -Name "Test, Tag, Release, and Publish" -On Demand, Push -Job PowerShellStaticAnalysis,
1114
TestPowerShellOnLinux,
1215
TagReleaseAndPublish,
13-
BuildHelpOut -OutputPath .\.github\workflows\TestReleaseAndPublish.yml -Env @{
16+
BuildHelpOut -OutputPath .\.github\workflows\TestReleaseAndPublish.yml -Env ([Ordered]@{
1417
"AT_PROTOCOL_HANDLE" = "mrpowershell.bsky.social"
15-
"AT_PROTOCOL_APP_PASSWORD" = '${{ secrets.AT_PROTOCOL_APP_PASSWORD }}'
16-
}
18+
"AT_PROTOCOL_APP_PASSWORD" = '${{ secrets.AT_PROTOCOL_APP_PASSWORD }}'
19+
REGISTRY = 'ghcr.io'
20+
IMAGE_NAME = '${{ github.repository }}'
21+
})
1722

1823
New-GitHubWorkflow -On Demand,
1924
Released -Job RunGitPub -Name OnIssueOrRelease -OutputPath .\.github\workflows\GitPub.yml

HelpOut.PSA.ps1 renamed to Build/HelpOut.PSA.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ $isMergeToMain =
2525
$gitHubEvent.ref -in 'refs/heads/main', 'refs/heads/master'
2626

2727
if ($isMergeToMain) {
28-
Import-Module .\HelpOut.psd1 -Global -PassThru | Out-Host
28+
Import-Module ..\HelpOut.psd1 -Global -PassThru | Out-Host
2929
$helpOutModule = Get-Module HelpOut
3030
$moduleAndVersion = "$($helpOutModule.Name) $($helpOutModule.Version)"
3131
$fullMessage = @(

HelpOut.PSSVG.ps1 renamed to Build/HelpOut.PSSVG.ps1

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#requires -Module PSSVG
2-
2+
Push-Location ($PSScriptRoot | Split-Path)
33
$psChevronPolygonPoints = @(
44
"40,20"
55
"45,20"
@@ -19,7 +19,7 @@ $psChevron =
1919

2020

2121

22-
$assetsPath = Join-Path $psScriptRoot Assets
22+
$assetsPath = Join-Path $pwd Assets
2323

2424
if (-not (Test-Path $assetsPath)) {
2525
$null = New-Item -ItemType Directory -Path $assetsPath -Force
@@ -33,3 +33,4 @@ svg @(
3333
svg.tspan "Out" -FontFamily 'sans-serif' -Dx '-0.3em' -Rotate 1 -Dy '0.0em' -FontSize 24 -Opacity .9
3434
) -FontSize 36 -Fill '#4488ff' -X 50% -DominantBaseline 'middle' -TextAnchor 'middle' -Y 50%
3535
) -ViewBox 300, 100 -OutputPath (Join-Path $assetsPath HelpOut.svg)
36+
Pop-Location

HelpOut.ezout.ps1 renamed to Build/HelpOut.ezout.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
# Install-Module EZOut or https://github.com/StartAutomating/EZOut
33
$myFile = $MyInvocation.MyCommand.ScriptBlock.File
44
$myModuleName = 'HelpOut'
5-
$myRoot = $myFile | Split-Path
5+
$myRoot = $myFile | Split-Path | Split-Path
66
Push-Location $myRoot
77
$formatting = @(
88
# Add your own Write-FormatView here,
99
# or put them in a Formatting or Views directory
10-
foreach ($potentialDirectory in 'Formatting','Views') {
10+
foreach ($potentialDirectory in 'Formatting','Views','Types') {
1111
Join-Path $myRoot $potentialDirectory |
1212
Get-ChildItem -ea ignore |
1313
Import-FormatView -FilePath {$_.Fullname}

CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1+
### HelpOut 0.5.4:
2+
3+
* HelpOut containerization
4+
* Dockerfile (#182)
5+
* Publishing to `https://ghcr.io/startautomating/helpout` (#183)
6+
* Container.init.ps1 (#191)
7+
* Container.start.ps1 (#193)
8+
* Container.stop.ps1 (#194)
9+
* Get/Save-Maml -IncludeAlias/-SkipCommandType (#178) (thanks @potatoqualitee ! )
10+
* Get-MarkdownHelp keeps alias names (#200)
11+
* HelpOut repository improvements
12+
* Organizing Files (#184, #185, #186, #187)
13+
* HelpOut is now exported as `$HelpOut` (#188)
14+
* HelpOut's root is now exported as `HelpOut:` (#189)
15+
* Extended Type Help Improvement:
16+
* Extended Member Titles (#198)
17+
* Fixing Grouping (#197)
18+
* Fixing Type File Naming (#196)
19+
20+
---
21+
122
### HelpOut 0.5.3:
223

324
* Save-MarkdownHelp:

0 commit comments

Comments
 (0)