Skip to content

Commit d026ea2

Browse files
Merge pull request #91 from StartAutomating/EZOut-Updates
Ez out updates
2 parents 5808f22 + 984b61e commit d026ea2

File tree

17 files changed

+308
-38
lines changed

17 files changed

+308
-38
lines changed

.github/workflows/OnIssue.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
2+
name: OnIssueChanged
3+
on:
4+
issues:
5+
workflow_dispatch:
6+
jobs:
7+
RunGitPub:
8+
runs-on: ubuntu-latest
9+
if: ${{ success() }}
10+
steps:
11+
- name: Check out repository
12+
uses: actions/checkout@v2
13+
- name: Use GitPub Action
14+
uses: StartAutomating/GitPub@main
15+
id: GitPub
16+
with:
17+
TargetBranch: edits-$([DateTime]::Now.ToString("r").Replace(":","-").Replace(" ", ""))
18+
CommitMessage: Posting with GitPub [skip ci]
19+
PublishParameters: |
20+
{
21+
"Get-GitPubIssue": {
22+
"Repository": '${{github.repository}}'
23+
},
24+
"Get-GitPubRelease": {
25+
"Repository": '${{github.repository}}'
26+
},
27+
"Publish-GitPubJekyll": {
28+
"OutputPath": "docs/_posts"
29+
}
30+
}
31+

.github/workflows/TestReleaseAndPublish.yml

Lines changed: 82 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,8 @@ jobs:
305305
$Parameters.UserName = ${env:UserName}
306306
$Parameters.TagVersionFormat = ${env:TagVersionFormat}
307307
$Parameters.ReleaseNameFormat = ${env:ReleaseNameFormat}
308+
$Parameters.ReleaseAsset = ${env:ReleaseAsset}
309+
$Parameters.ReleaseAsset = $parameters.ReleaseAsset -split ';' -replace '^[''"]' -replace '[''"]$'
308310
foreach ($k in @($parameters.Keys)) {
309311
if ([String]::IsNullOrEmpty($parameters[$k])) {
310312
$parameters.Remove($k)
@@ -330,7 +332,11 @@ jobs:
330332
331333
# The release name format (default value: '$($imported.Name) $($imported.Version)')
332334
[string]
333-
$ReleaseNameFormat = '$($imported.Name) $($imported.Version)'
335+
$ReleaseNameFormat = '$($imported.Name) $($imported.Version)',
336+
337+
# Any assets to attach to the release. Can be a wildcard or file name.
338+
[string[]]
339+
$ReleaseAsset
334340
)
335341
336342
@@ -376,32 +382,80 @@ jobs:
376382
377383
if ($releaseExists) {
378384
"::warning::Release '$($releaseExists.Name )' Already Exists" | Out-Host
379-
return
385+
$releasedIt = $releaseExists
386+
} else {
387+
$releasedIt = Invoke-RestMethod -Uri $releasesURL -Method Post -Body (
388+
[Ordered]@{
389+
owner = '${{github.owner}}'
390+
repo = '${{github.repository}}'
391+
tag_name = $targetVersion
392+
name = $ExecutionContext.InvokeCommand.ExpandString($ReleaseNameFormat)
393+
body =
394+
if ($env:RELEASENOTES) {
395+
$env:RELEASENOTES
396+
} elseif ($imported.PrivateData.PSData.ReleaseNotes) {
397+
$imported.PrivateData.PSData.ReleaseNotes
398+
} else {
399+
"$($imported.Name) $targetVersion"
400+
}
401+
draft = if ($env:RELEASEISDRAFT) { [bool]::Parse($env:RELEASEISDRAFT) } else { $false }
402+
prerelease = if ($env:PRERELEASE) { [bool]::Parse($env:PRERELEASE) } else { $false }
403+
} | ConvertTo-Json
404+
) -Headers @{
405+
"Accept" = "application/vnd.github.v3+json"
406+
"Content-type" = "application/json"
407+
"Authorization" = 'Bearer ${{ secrets.GITHUB_TOKEN }}'
408+
}
409+
}
410+
411+
412+
413+
414+
415+
if (-not $releasedIt) {
416+
throw "Release failed"
417+
} else {
418+
$releasedIt | Out-Host
380419
}
381420
421+
$releaseUploadUrl = $releasedIt.upload_url -replace '\{.+$'
382422
383-
Invoke-RestMethod -Uri $releasesURL -Method Post -Body (
384-
[Ordered]@{
385-
owner = '${{github.owner}}'
386-
repo = '${{github.repository}}'
387-
tag_name = $targetVersion
388-
name = $ExecutionContext.InvokeCommand.ExpandString($ReleaseNameFormat)
389-
body =
390-
if ($env:RELEASENOTES) {
391-
$env:RELEASENOTES
392-
} elseif ($imported.PrivateData.PSData.ReleaseNotes) {
393-
$imported.PrivateData.PSData.ReleaseNotes
394-
} else {
395-
"$($imported.Name) $targetVersion"
423+
if ($ReleaseAsset) {
424+
$fileList = Get-ChildItem -Recurse
425+
$filesToRelease =
426+
@(:nextFile foreach ($file in $fileList) {
427+
foreach ($relAsset in $ReleaseAsset) {
428+
if ($relAsset -match '[\*\?]') {
429+
if ($file.Name -like $relAsset) {
430+
$file; continue nextFile
431+
}
432+
} elseif ($file.Name -eq $relAsset -or $file.FullName -eq $relAsset) {
433+
$file; continue nextFile
434+
}
396435
}
397-
draft = if ($env:RELEASEISDRAFT) { [bool]::Parse($env:RELEASEISDRAFT) } else { $false }
398-
prerelease = if ($env:PRERELEASE) { [bool]::Parse($env:PRERELEASE) } else { $false }
399-
} | ConvertTo-Json
400-
) -Headers @{
401-
"Accept" = "application/vnd.github.v3+json"
402-
"Content-type" = "application/json"
403-
"Authorization" = 'Bearer ${{ secrets.GITHUB_TOKEN }}'
436+
})
437+
438+
$releasedFiles = @{}
439+
foreach ($file in $filesToRelease) {
440+
if ($releasedFiles[$file.Name]) {
441+
Write-Warning "Already attached file $($file.Name)"
442+
continue
443+
} else {
444+
$fileBytes = [IO.File]::ReadAllBytes($file.FullName)
445+
$releasedFiles[$file.Name] =
446+
Invoke-RestMethod -Uri "${releaseUploadUrl}?name=$($file.Name)" -Headers @{
447+
"Accept" = "application/vnd.github+json"
448+
"Authorization" = 'Bearer ${{ secrets.GITHUB_TOKEN }}'
449+
} -Body $fileBytes -ContentType Application/octet-stream
450+
$releasedFiles[$file.Name]
451+
}
452+
}
453+
454+
"Attached $($releasedFiles.Count) file(s) to release" | Out-Host
404455
}
456+
457+
458+
405459
} @Parameters
406460
- name: PublishPowerShellGallery
407461
id: PublishPowerShellGallery
@@ -515,18 +569,21 @@ jobs:
515569
}
516570
}
517571
} @Parameters
518-
BuildModule:
572+
BuildEZOut:
519573
runs-on: ubuntu-latest
520574
if: ${{ success() }}
521575
steps:
522576
- name: Check out repository
523577
uses: actions/checkout@v2
578+
- name: Use PSSVG Action
579+
uses: StartAutomating/PSSVG@main
580+
id: PSSVG
581+
- name: UsePiecemeal
582+
uses: StartAutomating/Piecemeal@main
524583
- name: BuildPipeScript
525584
uses: StartAutomating/PipeScript@main
526585
- name: UseEZOut
527586
uses: StartAutomating/EZOut@master
528-
- name: UsePiecemeal
529-
uses: StartAutomating/Piecemeal@main
530587
- name: UseHelpOut
531588
uses: StartAutomating/HelpOut@master
532589

Assets/EZOut.svg

Lines changed: 11 additions & 0 deletions
Loading

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
1+
## 1.9.7:
2+
* Format-RichText now unbolds bright colors (Fixes #88)
3+
* Now Blogging with GitPub (Fixes #89)
4+
* New Logo (Fixes #90)
5+
6+
---
7+
18
## 1.9.6:
29
* Added Format-JSON (Fixes #86)
310
* Improved GitHub Action (Fixes #85)
11+
412
---
513

614
## 1.9.5:
@@ -12,8 +20,10 @@
1220
* Adding -Hide
1321
* Format-RichText:
1422
* Adding plural alias for -Italic (Fixes #83)
23+
1524
---
1625

26+
1727
## 1.9.4:
1828
* Formatting Improvements:
1929
* Adding Colorized Formatter for Get-Member
@@ -24,42 +34,50 @@
2434
* Adding -Hide (#78)
2535
* Adding -Italic (#76)
2636
* Fixing -Strikethru behavior (#79)
37+
2738
---
2839

2940
## 1.9.3:
3041
* Import-TypeView/Import-FormatView: Skipping PipeScript Files (Fixes #73)
42+
3143
---
3244

3345
## 1.9.2:
3446
* Format-Markdown:
3547
* Improving Handling of | (Fixes #71)
3648
* Not escaping code blocks (undoes #69)
3749
* No longer including images with PowerShell Gallery package (Fixes #67)
50+
3851
---
3952

4053
## 1.9.1:
4154
* Format-Markdown: Escaping -Code blocks (Fixes #69)
55+
4256
---
4357

4458
## 1.9.0:
4559
* Format-Hashtable: Better Handling of [string]s, [enum]s, and primitive types (Fixes #64).
4660
* Format-YAML:
4761
* Added -Depth (Fixes #65)
4862
* Supporting Enums (Fixes #66)
63+
4964
---
5065

5166
## 1.8.9:
5267
* Added Format-Hashtable (Fixes #61)
5368
* Import-TypeView now supports hidden properties (Fixes #62)
69+
5470
---
5571

5672
## 1.8.8.1:
5773
* Format-YAML now supports -Indent (Fixes #59)
5874
* Format-YAML now supports all primitive types (Fixes #58). Thanks @dfinke!
75+
5976
---
6077

6178
## 1.8.8:
6279
* Write-EZFormatFile generates scripts that output files. Fixes #56 and #43.
80+
6381
---
6482

6583
## 1.8.7:
@@ -68,6 +86,7 @@
6886
* Import-TypeView: Allowing Typename.txt file to redefine typename (#48)
6987
* Self-hosting action (#52)
7088
* GitHub Action now carries on commit message (#54)
89+
7190
---
7291

7392
## 1.8.6
@@ -96,4 +115,5 @@
96115
* Adding Format-RichText (#27)
97116
* Adding Format-Object (#25, #26)
98117
* Adding workflow definition (#37)
118+
99119
---

EZOut.PSSVG.ps1

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#requires -Module PSSVG
2+
3+
$psChevronPolygonPoints = @(
4+
"40,20"
5+
"45,20"
6+
"60,50"
7+
"35,80"
8+
"32.5,80"
9+
"55,50"
10+
) -join ' '
11+
12+
$psChevronPolygon =
13+
=<svg.polygon> -Points $psChevronPolygonPoints
14+
15+
$psChevron =
16+
=<svg.symbol> -Id psChevron -Content @(
17+
$psChevronPolygon
18+
) -ViewBox 100, 100 -PreserveAspectRatio $false
19+
20+
21+
22+
$assetsPath = Join-Path $psScriptRoot Assets
23+
24+
25+
=<svg> @(
26+
$psChevron
27+
=<svg.use> -href '#psChevron' -X '63%' -Y '-2%' -Width '9.5%' -Stroke '#4488ff' -Fill '#4488ff' -Opacity .8
28+
=<svg.text> @(
29+
=<svg.tspan> "EZ" -FontFamily 'sans-serif'
30+
=<svg.tspan> "OUT" -FontFamily 'sans-serif' -Dx '-0.3em' -Rotate 1 -Dy '0.0em' -FontSize 24 -Opacity .9
31+
) -FontSize 36 -Fill '#4488ff' -X 50% -DominantBaseline 'middle' -TextAnchor 'middle' -Y 50%
32+
) -ViewBox 300, 100 -OutputPath (Join-Path $assetsPath EZOut.svg)

EZOut.format.ps1xml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-16"?>
2-
<!-- Generated with EZOut 1.9.6: Install-Module EZOut or https://github.com/StartAutomating/EZOut -->
2+
<!-- Generated with EZOut 1.9.7: Install-Module EZOut or https://github.com/StartAutomating/EZOut -->
33
<Configuration>
44
<SelectionSets>
55
<SelectionSet>
@@ -1041,7 +1041,7 @@ if ($Request -or $Host.UI.SupportsHTML) {
10411041

10421042
$n =0
10431043
$cssClasses = @()
1044-
$styleAttributes =
1044+
$colorAttributes =
10451045
@(:nextColor foreach ($hc in $ForegroundColor,$BackgroundColor) {
10461046
$n++
10471047
if (-not $hc) { continue }
@@ -1173,6 +1173,7 @@ if ($Request -or $Host.UI.SupportsHTML) {
11731173

11741174
})
11751175

1176+
$styleAttributes = @() + $colorAttributes
11761177

11771178
$styleAttributes += @(
11781179
if ($Bold) {
@@ -1247,7 +1248,7 @@ if ($Request -or $Host.UI.SupportsHTML) {
12471248
"&lt;/span&gt;"
12481249
}
12491250
elseif ($canUseANSI) {
1250-
if ($Bold -or $Faint) {
1251+
if ($Bold -or $Faint -or $colorAttributes -match '\[1;') {
12511252
"$esc[22m"
12521253
}
12531254
if ($Italic) {

0 commit comments

Comments
 (0)