-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #96 from StartAutomating/EventfulDemos
Eventful demos
- Loading branch information
Showing
65 changed files
with
1,664 additions
and
967 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
|
||
name: show-demo-psa | ||
on: | ||
workflow_dispatch: | ||
jobs: | ||
SendPSA: | ||
runs-on: ubuntu-latest | ||
if: ${{ success() }} | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v3 | ||
- name: PSA | ||
uses: StartAutomating/PSA@main | ||
id: PSA | ||
env: | ||
AT_PROTOCOL_APP_PASSWORD: ${{ secrets.AT_PROTOCOL_APP_PASSWORD }} | ||
AT_PROTOCOL_HANDLE: mrpowershell.bsky.social |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
@{ | ||
"runs-on" = "ubuntu-latest" | ||
if = '${{ success() }}' | ||
steps = @( | ||
@{ | ||
name = 'Check out repository' | ||
uses = 'actions/checkout@v3' | ||
}, | ||
@{ | ||
name = 'PSA' | ||
uses = 'StartAutomating/PSA@main' | ||
id = 'PSA' | ||
} | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Any *.PSA.ps1 file will be run when PSA runs. | ||
|
||
# A good thing to do at the start of this file is to connect. | ||
|
||
Connect-BlueSky | ||
|
||
# If $env:AT_PROTOCOL_HANDLE or $env:AT_PROTOCOL_EMAIL is set, it will be treated as the username | ||
# If $env:AT_PROTOCOL_APP_PASSWORD is set, it will be treated as the App Password. | ||
# _Never_ use your actual BlueSky password | ||
|
||
# Once we're connected, we can do anything our app password allows. | ||
|
||
# However, you _might_ want to output some information first, so that you can see you're connected. | ||
|
||
Get-BskyActorProfile -Actor $env:AT_PROTOCOL_HANDLE -Cache | Out-Host | ||
|
||
# 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 | ||
|
||
# There will be a variable, $GitHubEvent, that contains information about the event. | ||
|
||
# A fairly common scenario is to perform an annoucement whenever a PR is merged. | ||
|
||
$isMergeToMain = | ||
($gitHubEvent.head_commit.message -match "Merge Pull Request #(?<PRNumber>\d+)") -and | ||
$gitHubEvent.ref -eq 'refs/heads/main' | ||
|
||
$importedModule = Import-Module .\ShowDemo.psd1 -Global -PassThru | ||
$importedModule | Out-Host | ||
$moduleAndVersion = "$($importedModule.Name) $($importedModule.Version)" | ||
|
||
$isManuallyTriggered = $gitHubEvent.psobject.properties["inputs"] | ||
|
||
if ($isMergeToMain -or $isManuallyTriggered) { | ||
|
||
$fullMessage = @( | ||
"Show off your scripts", | ||
"Demo your PowerShell", | ||
"Never typo during a talk again" | Get-Random | ||
|
||
"$($ImportedModule.Name)" | ||
) -join [Environment]::NewLine | ||
|
||
$sendSplat = [Ordered]@{ | ||
Text = $fullMessage | ||
} | ||
if ($importedModule.PrivateData.PSData.ProjectURI) { | ||
$sendSplat.WebCard = @{Url=$importedModule.PrivateData.PSData.ProjectURI} | ||
$sendSplat.LinkPattern = @{$importedModule.Name=$importedModule.PrivateData.PSData.ProjectURI} | ||
} | ||
|
||
Send-AtProto @sendSplat | ||
return | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#requires -Module PSSVG | ||
Push-Location ($psScriptRoot | Split-Path) | ||
$powerShellChevron = Invoke-RestMethod https://pssvg.start-automating.com/Examples/PowerShellChevron.svg | ||
$assetsPath = Join-Path $pwd Assets | ||
$scaleMin = 1 | ||
$scaleMax = 1.02 | ||
|
||
|
||
$FontSplat = [Ordered]@{ | ||
FontFamily = "sans-serif" | ||
} | ||
|
||
$φ = (1.0 + [Math]::Sqrt(5))/2 | ||
|
||
$AnimateSplat = [Ordered]@{ | ||
Dur = 60/128*8 | ||
AttributeName = 'font-size' | ||
Values = "${scaleMin}em;${scaleMax}em;${scaleMin}em" | ||
RepeatCount = 'indefinite' | ||
} | ||
|
||
$AnimateSplat2 = [Ordered]@{} + $AnimateSplat | ||
$AnimateSplat2.Values = "${scaleMax}em;${scaleMin}em;${scaleMax}em" | ||
|
||
if (-not (Test-path $assetsPath)) { | ||
$null = New-Item -ItemType Directory -Path $assetsPath -Force | ||
} | ||
|
||
|
||
foreach ($variant in '','animated') { | ||
svg @( | ||
SVG.GoogleFont -FontName $FontName | ||
svg.symbol -ViewBox $powerShellChevron.svg.viewBox -Content $powerShellChevron.svg.symbol.InnerXml -Id psChevron | ||
$RectSplat = [Ordered]@{ | ||
Rx=30 | ||
Ry=(30 / $φ) | ||
Stroke="#4488ff" | ||
StrokeWidth="1%" | ||
Fill='transparent' | ||
Width = 250 | ||
Height = 250 / $φ | ||
X = 25 | ||
Y = 25 / $φ | ||
} | ||
SVG.rect @RectSplat | ||
|
||
svg.use -href '#psChevron' -X '12.5%' -Y '-2%' -Width '12.5%' -Stroke '#4488ff' -Fill '#4488ff' | ||
svg.text @( | ||
svg.tspan "Show" -Children @( | ||
if ($variant -match 'animated') { | ||
SVG.animate @AnimateSplat | ||
} | ||
) -FontSize "${scaleMin}em" | ||
svg.tspan "Demo" -Children @( | ||
if ($variant -match 'animated') { | ||
SVG.animate @AnimateSplat2 -Begin ($dur / 2) | ||
} | ||
) -FontSize "${scaleMin}em" | ||
) -FontSize 32 -Fill '#4488ff' -X 50% -DominantBaseline 'middle' -TextAnchor 'middle' -Y 50% @FontSplat | ||
) -ViewBox 300, ([Math]::Floor(300 / $φ)) -OutputPath (Join-Path $assetsPath "ShowDemo$(if ($variant){"-$($variant)"}).svg") | ||
} | ||
|
||
Pop-Location |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.