Skip to content

Commit

Permalink
Merge pull request #91 from StartAutomating/EZOut-Updates
Browse files Browse the repository at this point in the history
Ez out updates
  • Loading branch information
StartAutomating authored Oct 20, 2022
2 parents 5808f22 + 984b61e commit d026ea2
Show file tree
Hide file tree
Showing 17 changed files with 308 additions and 38 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/OnIssue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

name: OnIssueChanged
on:
issues:
workflow_dispatch:
jobs:
RunGitPub:
runs-on: ubuntu-latest
if: ${{ success() }}
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Use GitPub Action
uses: StartAutomating/GitPub@main
id: GitPub
with:
TargetBranch: edits-$([DateTime]::Now.ToString("r").Replace(":","-").Replace(" ", ""))
CommitMessage: Posting with GitPub [skip ci]
PublishParameters: |
{
"Get-GitPubIssue": {
"Repository": '${{github.repository}}'
},
"Get-GitPubRelease": {
"Repository": '${{github.repository}}'
},
"Publish-GitPubJekyll": {
"OutputPath": "docs/_posts"
}
}
107 changes: 82 additions & 25 deletions .github/workflows/TestReleaseAndPublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,8 @@ jobs:
$Parameters.UserName = ${env:UserName}
$Parameters.TagVersionFormat = ${env:TagVersionFormat}
$Parameters.ReleaseNameFormat = ${env:ReleaseNameFormat}
$Parameters.ReleaseAsset = ${env:ReleaseAsset}
$Parameters.ReleaseAsset = $parameters.ReleaseAsset -split ';' -replace '^[''"]' -replace '[''"]$'
foreach ($k in @($parameters.Keys)) {
if ([String]::IsNullOrEmpty($parameters[$k])) {
$parameters.Remove($k)
Expand All @@ -330,7 +332,11 @@ jobs:
# The release name format (default value: '$($imported.Name) $($imported.Version)')
[string]
$ReleaseNameFormat = '$($imported.Name) $($imported.Version)'
$ReleaseNameFormat = '$($imported.Name) $($imported.Version)',
# Any assets to attach to the release. Can be a wildcard or file name.
[string[]]
$ReleaseAsset
)
Expand Down Expand Up @@ -376,32 +382,80 @@ jobs:
if ($releaseExists) {
"::warning::Release '$($releaseExists.Name )' Already Exists" | Out-Host
return
$releasedIt = $releaseExists
} else {
$releasedIt = Invoke-RestMethod -Uri $releasesURL -Method Post -Body (
[Ordered]@{
owner = '${{github.owner}}'
repo = '${{github.repository}}'
tag_name = $targetVersion
name = $ExecutionContext.InvokeCommand.ExpandString($ReleaseNameFormat)
body =
if ($env:RELEASENOTES) {
$env:RELEASENOTES
} elseif ($imported.PrivateData.PSData.ReleaseNotes) {
$imported.PrivateData.PSData.ReleaseNotes
} else {
"$($imported.Name) $targetVersion"
}
draft = if ($env:RELEASEISDRAFT) { [bool]::Parse($env:RELEASEISDRAFT) } else { $false }
prerelease = if ($env:PRERELEASE) { [bool]::Parse($env:PRERELEASE) } else { $false }
} | ConvertTo-Json
) -Headers @{
"Accept" = "application/vnd.github.v3+json"
"Content-type" = "application/json"
"Authorization" = 'Bearer ${{ secrets.GITHUB_TOKEN }}'
}
}
if (-not $releasedIt) {
throw "Release failed"
} else {
$releasedIt | Out-Host
}
$releaseUploadUrl = $releasedIt.upload_url -replace '\{.+$'
Invoke-RestMethod -Uri $releasesURL -Method Post -Body (
[Ordered]@{
owner = '${{github.owner}}'
repo = '${{github.repository}}'
tag_name = $targetVersion
name = $ExecutionContext.InvokeCommand.ExpandString($ReleaseNameFormat)
body =
if ($env:RELEASENOTES) {
$env:RELEASENOTES
} elseif ($imported.PrivateData.PSData.ReleaseNotes) {
$imported.PrivateData.PSData.ReleaseNotes
} else {
"$($imported.Name) $targetVersion"
if ($ReleaseAsset) {
$fileList = Get-ChildItem -Recurse
$filesToRelease =
@(:nextFile foreach ($file in $fileList) {
foreach ($relAsset in $ReleaseAsset) {
if ($relAsset -match '[\*\?]') {
if ($file.Name -like $relAsset) {
$file; continue nextFile
}
} elseif ($file.Name -eq $relAsset -or $file.FullName -eq $relAsset) {
$file; continue nextFile
}
}
draft = if ($env:RELEASEISDRAFT) { [bool]::Parse($env:RELEASEISDRAFT) } else { $false }
prerelease = if ($env:PRERELEASE) { [bool]::Parse($env:PRERELEASE) } else { $false }
} | ConvertTo-Json
) -Headers @{
"Accept" = "application/vnd.github.v3+json"
"Content-type" = "application/json"
"Authorization" = 'Bearer ${{ secrets.GITHUB_TOKEN }}'
})
$releasedFiles = @{}
foreach ($file in $filesToRelease) {
if ($releasedFiles[$file.Name]) {
Write-Warning "Already attached file $($file.Name)"
continue
} else {
$fileBytes = [IO.File]::ReadAllBytes($file.FullName)
$releasedFiles[$file.Name] =
Invoke-RestMethod -Uri "${releaseUploadUrl}?name=$($file.Name)" -Headers @{
"Accept" = "application/vnd.github+json"
"Authorization" = 'Bearer ${{ secrets.GITHUB_TOKEN }}'
} -Body $fileBytes -ContentType Application/octet-stream
$releasedFiles[$file.Name]
}
}
"Attached $($releasedFiles.Count) file(s) to release" | Out-Host
}
} @Parameters
- name: PublishPowerShellGallery
id: PublishPowerShellGallery
Expand Down Expand Up @@ -515,18 +569,21 @@ jobs:
}
}
} @Parameters
BuildModule:
BuildEZOut:
runs-on: ubuntu-latest
if: ${{ success() }}
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Use PSSVG Action
uses: StartAutomating/PSSVG@main
id: PSSVG
- name: UsePiecemeal
uses: StartAutomating/Piecemeal@main
- name: BuildPipeScript
uses: StartAutomating/PipeScript@main
- name: UseEZOut
uses: StartAutomating/EZOut@master
- name: UsePiecemeal
uses: StartAutomating/Piecemeal@main
- name: UseHelpOut
uses: StartAutomating/HelpOut@master

11 changes: 11 additions & 0 deletions Assets/EZOut.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
## 1.9.7:
* Format-RichText now unbolds bright colors (Fixes #88)
* Now Blogging with GitPub (Fixes #89)
* New Logo (Fixes #90)

---

## 1.9.6:
* Added Format-JSON (Fixes #86)
* Improved GitHub Action (Fixes #85)

---

## 1.9.5:
Expand All @@ -12,8 +20,10 @@
* Adding -Hide
* Format-RichText:
* Adding plural alias for -Italic (Fixes #83)

---


## 1.9.4:
* Formatting Improvements:
* Adding Colorized Formatter for Get-Member
Expand All @@ -24,42 +34,50 @@
* Adding -Hide (#78)
* Adding -Italic (#76)
* Fixing -Strikethru behavior (#79)

---

## 1.9.3:
* Import-TypeView/Import-FormatView: Skipping PipeScript Files (Fixes #73)

---

## 1.9.2:
* Format-Markdown:
* Improving Handling of | (Fixes #71)
* Not escaping code blocks (undoes #69)
* No longer including images with PowerShell Gallery package (Fixes #67)

---

## 1.9.1:
* Format-Markdown: Escaping -Code blocks (Fixes #69)

---

## 1.9.0:
* Format-Hashtable: Better Handling of [string]s, [enum]s, and primitive types (Fixes #64).
* Format-YAML:
* Added -Depth (Fixes #65)
* Supporting Enums (Fixes #66)

---

## 1.8.9:
* Added Format-Hashtable (Fixes #61)
* Import-TypeView now supports hidden properties (Fixes #62)

---

## 1.8.8.1:
* Format-YAML now supports -Indent (Fixes #59)
* Format-YAML now supports all primitive types (Fixes #58). Thanks @dfinke!

---

## 1.8.8:
* Write-EZFormatFile generates scripts that output files. Fixes #56 and #43.

---

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

---

## 1.8.6
Expand Down Expand Up @@ -96,4 +115,5 @@
* Adding Format-RichText (#27)
* Adding Format-Object (#25, #26)
* Adding workflow definition (#37)

---
32 changes: 32 additions & 0 deletions EZOut.PSSVG.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#requires -Module PSSVG

$psChevronPolygonPoints = @(
"40,20"
"45,20"
"60,50"
"35,80"
"32.5,80"
"55,50"
) -join ' '

$psChevronPolygon =
=<svg.polygon> -Points $psChevronPolygonPoints

$psChevron =
=<svg.symbol> -Id psChevron -Content @(
$psChevronPolygon
) -ViewBox 100, 100 -PreserveAspectRatio $false



$assetsPath = Join-Path $psScriptRoot Assets


=<svg> @(
$psChevron
=<svg.use> -href '#psChevron' -X '63%' -Y '-2%' -Width '9.5%' -Stroke '#4488ff' -Fill '#4488ff' -Opacity .8
=<svg.text> @(
=<svg.tspan> "EZ" -FontFamily 'sans-serif'
=<svg.tspan> "OUT" -FontFamily 'sans-serif' -Dx '-0.3em' -Rotate 1 -Dy '0.0em' -FontSize 24 -Opacity .9
) -FontSize 36 -Fill '#4488ff' -X 50% -DominantBaseline 'middle' -TextAnchor 'middle' -Y 50%
) -ViewBox 300, 100 -OutputPath (Join-Path $assetsPath EZOut.svg)
7 changes: 4 additions & 3 deletions EZOut.format.ps1xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-16"?>
<!-- Generated with EZOut 1.9.6: Install-Module EZOut or https://github.com/StartAutomating/EZOut -->
<!-- Generated with EZOut 1.9.7: Install-Module EZOut or https://github.com/StartAutomating/EZOut -->
<Configuration>
<SelectionSets>
<SelectionSet>
Expand Down Expand Up @@ -1041,7 +1041,7 @@ if ($Request -or $Host.UI.SupportsHTML) {

$n =0
$cssClasses = @()
$styleAttributes =
$colorAttributes =
@(:nextColor foreach ($hc in $ForegroundColor,$BackgroundColor) {
$n++
if (-not $hc) { continue }
Expand Down Expand Up @@ -1173,6 +1173,7 @@ if ($Request -or $Host.UI.SupportsHTML) {

})

$styleAttributes = @() + $colorAttributes

$styleAttributes += @(
if ($Bold) {
Expand Down Expand Up @@ -1247,7 +1248,7 @@ if ($Request -or $Host.UI.SupportsHTML) {
"&lt;/span&gt;"
}
elseif ($canUseANSI) {
if ($Bold -or $Faint) {
if ($Bold -or $Faint -or $colorAttributes -match '\[1;') {
"$esc[22m"
}
if ($Italic) {
Expand Down
Loading

0 comments on commit d026ea2

Please sign in to comment.