Skip to content

Commit a31fbd1

Browse files
author
James Brundage
committed
feat: ollama-powershell core ( Fixes #1 )
Isolating existing code into new module
1 parent bdfbf40 commit a31fbd1

14 files changed

+969
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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 = 'GitLogger'
11+
uses = 'GitLogging/GitLoggerAction@main'
12+
id = 'GitLogger'
13+
}
14+
@{
15+
name = 'Use PSSVG Action'
16+
uses = 'StartAutomating/PSSVG@main'
17+
id = 'PSSVG'
18+
}
19+
@{
20+
name = 'Use PipeScript Action'
21+
uses = 'StartAutomating/PipeScript@main'
22+
id = 'PipeScript'
23+
}
24+
'RunEZOut'
25+
'RunHelpOut'
26+
<#,
27+
@{
28+
name = 'Use PSJekyll Action'
29+
uses = 'PowerShellWeb/PSJekyll@main'
30+
id = 'PSJekyll'
31+
}#>
32+
<#@{
33+
name = 'Run WebSocket (on branch)'
34+
if = '${{github.ref_name != ''main''}}'
35+
uses = './'
36+
id = 'WebSocketAction'
37+
},#>
38+
# 'BuildAndPublishContainer'
39+
)
40+
}
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
@{
2+
name = 'PublishTestResults'
3+
uses = 'actions/upload-artifact@main'
4+
with = @{
5+
name = 'PesterResults'
6+
path = '**.TestResults.xml'
7+
}
8+
if = '${{always()}}'
9+
}
10+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#requires -Module PSDevOps
2+
Import-BuildStep -SourcePath (
3+
Join-Path $PSScriptRoot 'GitHub'
4+
) -BuildSystem GitHubWorkflow
5+
6+
Push-Location ($PSScriptRoot | Split-Path)
7+
New-GitHubWorkflow -Name "Build ollama-powershell" -On Push,
8+
PullRequest,
9+
Demand -Job TestPowerShellOnLinux,
10+
TagReleaseAndPublish, BuildOllamaPowerShell -Environment ([Ordered]@{
11+
REGISTRY = 'ghcr.io'
12+
IMAGE_NAME = '${{ github.repository }}'
13+
}) -OutputPath .\.github\workflows\BuildOllamaPowerShell.yml
14+
15+
Pop-Location

Build/ollama-powershell.ezout.ps1

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#requires -Module EZOut
2+
# Install-Module EZOut or https://github.com/StartAutomating/EZOut
3+
$myFile = $MyInvocation.MyCommand.ScriptBlock.File
4+
$myRoot = $myFile | Split-Path | Split-Path
5+
$myModuleName = $myFile | Split-Path | Split-Path | Split-Path -Leaf
6+
Push-Location $myRoot
7+
$formatting = @(
8+
# Add your own Write-FormatView here,
9+
# or put them in a Formatting or Views directory
10+
foreach ($potentialDirectory in 'Formatting','Views','Types') {
11+
Join-Path $myRoot $potentialDirectory |
12+
Get-ChildItem -ea ignore |
13+
Import-FormatView -FilePath {$_.Fullname}
14+
}
15+
)
16+
17+
$destinationRoot = $myRoot
18+
19+
if ($formatting) {
20+
$myFormatFilePath = Join-Path $destinationRoot "$myModuleName.format.ps1xml"
21+
# You can also output to multiple paths by passing a hashtable to -OutputPath.
22+
$formatting | Out-FormatData -Module $MyModuleName -OutputPath $myFormatFilePath
23+
}
24+
25+
$types = @(
26+
# Add your own Write-TypeView statements here
27+
# or declare them in the 'Types' directory
28+
Join-Path $myRoot Types |
29+
Get-Item -ea ignore |
30+
Import-TypeView
31+
32+
)
33+
34+
if ($types) {
35+
$myTypesFilePath = Join-Path $destinationRoot "$myModuleName.types.ps1xml"
36+
# You can also output to multiple paths by passing a hashtable to -OutputPath.
37+
$types | Out-TypeData -OutputPath $myTypesFilePath
38+
}
39+
Pop-Location

CODE_OF_CONDUCT.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Code of Conduct
2+
3+
We have a simple subjective code of conduct:
4+
5+
1. Be Respectful
6+
2. Be Helpful
7+
3. Do No Harm
8+
9+
Failure to follow the code of conduct may result in blocks or banishment.

CONTRIBUTING.md

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Contributing
2+
3+
## Who Can Contribute?
4+
5+
We welcome all contributions, as long as they're related to using ollama and PowerShell.
6+
7+
## What Can I Contribute?
8+
9+
You can contribute issues and pull requests containing new PowerShell functions or documentation.
10+
11+
We welcome integrations with any AI APIs and tools out there.
12+
13+
## Why Contribute?
14+
15+
You should contribute to help the community, and share your knowledge.
16+
17+
This module is meant to be a grab bag of AI fun in PowerShell,
18+
and your contribution can bring more joy and knowledge to the world.

0 commit comments

Comments
 (0)