Skip to content

Commit 01e9fdd

Browse files
Merge pull request #193 from StartAutomating/EZ-Improvements
EZOut 2.0.2
2 parents b4cdb58 + 7589434 commit 01e9fdd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+1371
-395
lines changed

.github/workflows/SendPSA.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
2+
name: show-demo-psa
3+
on:
4+
workflow_dispatch:
5+
jobs:
6+
SendPSA:
7+
runs-on: ubuntu-latest
8+
if: ${{ success() }}
9+
steps:
10+
- name: Check out repository
11+
uses: actions/checkout@v3
12+
- name: PSA
13+
uses: StartAutomating/PSA@main
14+
id: PSA
15+
env:
16+
AT_PROTOCOL_APP_PASSWORD: ${{ secrets.AT_PROTOCOL_APP_PASSWORD }}
17+
AT_PROTOCOL_HANDLE: mrpowershell.bsky.social

.github/workflows/TestReleaseAndPublish.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,4 +600,9 @@ jobs:
600600
- name: GitLogger
601601
uses: GitLogging/GitLoggerAction@main
602602
id: GitLogger
603-
603+
- name: PSA
604+
uses: StartAutomating/PSA@main
605+
id: PSA
606+
env:
607+
AT_PROTOCOL_APP_PASSWORD: ${{ secrets.AT_PROTOCOL_APP_PASSWORD }}
608+
AT_PROTOCOL_HANDLE: mrpowershell.bsky.social

Build/EZOut.GitHubAction.PSDevOps.ps1

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#requires -Module PSDevOps
22
#requires -Module EZOut
3-
Import-BuildStep -ModuleName EZOut
3+
Import-BuildStep -SourcePath (
4+
Join-Path $PSScriptRoot 'GitHub'
5+
) -BuildSystem GitHubWorkflow
6+
47
Push-Location ($PSScriptRoot | Split-Path)
58
New-GitHubAction -Name "UseEZOut" -Description @'
69
Generate Formatting and Types .ps1xml for PowerShell Modules, using EZOut
Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,31 @@
11
#requires -Module EZOut
22
#requires -Module PSDevOps
3-
Import-BuildStep -ModuleName EZOut
3+
4+
Import-BuildStep -SourcePath (
5+
Join-Path $PSScriptRoot 'GitHub'
6+
) -BuildSystem GitHubWorkflow
7+
48
Push-Location ($PSScriptRoot | Split-Path)
59
New-GitHubWorkflow -Name "Test, Tag, Release, and Publish" -On Demand, Push -Job PowerShellStaticAnalysis,
610
TestPowerShellOnLinux,
711
TagReleaseAndPublish,
812
BuildEZOut -OutputPath (
913
Join-Path $pwd .\.github\workflows\TestReleaseAndPublish.yml
10-
)
14+
) -Env @{
15+
"AT_PROTOCOL_HANDLE" = "mrpowershell.bsky.social"
16+
"AT_PROTOCOL_APP_PASSWORD" = '${{ secrets.AT_PROTOCOL_APP_PASSWORD }}'
17+
}
1118

1219
New-GitHubWorkflow -On Demand -Job RunGitPub -Name OnIssueChanged -OutputPath (
1320
Join-Path $pwd .github\workflows\GitPub.yml
1421
)
1522

23+
New-GitHubWorkflow -On Demand -Name 'show-demo-psa' -Job SendPSA -OutputPath (
24+
Join-Path $pwd .\.github\workflows\SendPSA.yml
25+
) -Env @{
26+
"AT_PROTOCOL_HANDLE" = "mrpowershell.bsky.social"
27+
"AT_PROTOCOL_APP_PASSWORD" = '${{ secrets.AT_PROTOCOL_APP_PASSWORD }}'
28+
}
29+
30+
1631
Pop-Location

Build/EZOut.PSA.ps1

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Any *.PSA.ps1 file will be run when PSA runs.
2+
3+
# A good thing to do at the start of this file is to connect.
4+
5+
Connect-BlueSky
6+
7+
# If $env:AT_PROTOCOL_HANDLE or $env:AT_PROTOCOL_EMAIL is set, it will be treated as the username
8+
# If $env:AT_PROTOCOL_APP_PASSWORD is set, it will be treated as the App Password.
9+
# _Never_ use your actual BlueSky password
10+
11+
# Once we're connected, we can do anything our app password allows.
12+
13+
# However, you _might_ want to output some information first, so that you can see you're connected.
14+
15+
Get-BskyActorProfile -Actor $env:AT_PROTOCOL_HANDLE -Cache | Out-Host
16+
17+
# To ensure you're not going to send a skeet on every checkin, it's a good idea to ask what GitHub is up to
18+
19+
# There will be a variable, $GitHubEvent, that contains information about the event.
20+
21+
# A fairly common scenario is to perform an annoucement whenever a PR is merged.
22+
23+
$isMergeToMain =
24+
($gitHubEvent.head_commit.message -match "Merge Pull Request #(?<PRNumber>\d+)") -and
25+
$gitHubEvent.ref -eq 'refs/heads/main'
26+
27+
Push-Location ($PSScriptRoot | Split-Path)
28+
29+
$importedModule = Import-Module .\EZOut.psd1 -Global -PassThru
30+
$importedModule | Out-Host
31+
$moduleAndVersion = "$($importedModule.Name) $($importedModule.Version)"
32+
33+
$isManuallyTriggered = $gitHubEvent.psobject.properties["inputs"]
34+
35+
if ($isMergeToMain -or $isManuallyTriggered) {
36+
37+
$fullMessage = @(
38+
$importedModule.PrivateData.Taglines | Get-Random
39+
40+
"$($importedModule.PrivateData.PSData.ProjectURI)"
41+
) -join [Environment]::NewLine
42+
43+
$sendSplat = [Ordered]@{
44+
Text = $fullMessage
45+
}
46+
if ($importedModule.PrivateData.PSData.ProjectURI) {
47+
$sendSplat.WebCard = @{Url=$importedModule.PrivateData.PSData.ProjectURI}
48+
$sendSplat.LinkPattern = @{$importedModule.Name=$importedModule.PrivateData.PSData.ProjectURI}
49+
}
50+
51+
Send-AtProto @sendSplat
52+
}
53+
54+
Pop-Location
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,16 @@
3434
uses = './'
3535
id = 'EZOutBranch'
3636
},
37-
'RunHelpOut',
37+
'RunHelpOut',
3838
@{
3939
name = 'GitLogger'
4040
uses = 'GitLogging/GitLoggerAction@main'
4141
id = 'GitLogger'
42+
},
43+
@{
44+
name = 'PSA'
45+
uses = 'StartAutomating/PSA@main'
46+
id = 'PSA'
4247
}
43-
4448
)
4549
}

Build/GitHub/Jobs/SendPSA.psd1

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
@{
2+
"runs-on" = "ubuntu-latest"
3+
if = '${{ success() }}'
4+
steps = @(
5+
@{
6+
name = 'Check out repository'
7+
uses = 'actions/checkout@v3'
8+
},
9+
@{
10+
name = 'PSA'
11+
uses = 'StartAutomating/PSA@main'
12+
id = 'PSA'
13+
}
14+
)
15+
}

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
## 2.0.2
2+
3+
* Import Improvements
4+
* Import-TypeView - -TextFileType (#174)
5+
* Import-TypeView - *.class.ps1 will become netproperties (#167)
6+
* Import-FormatView - Adding -FormatFilePattern (#175)
7+
* Import-FormatView - Including *.control.ps1 (#162)
8+
* Output Improvements
9+
* Out-TypeData -OutputPath (#173, #178)
10+
* Out-FormatData -OutputPath (#172, #177)
11+
* Write-EZFormatFile -OutputPath (#179/#180)
12+
* Write-EZFormatFile piping support (#188)
13+
* Out-Alternate - Adding -ModuleName/-PS1XMLPath (#163)
14+
* Integrated PSA into build (#189, #190, #191, #192)
15+
16+
---
17+
118
## 2.0.1
219

320
* Formatting can now live in the Types directory!

0 commit comments

Comments
 (0)