Skip to content

Commit

Permalink
create action
Browse files Browse the repository at this point in the history
  • Loading branch information
PixelRobots committed Sep 25, 2024
1 parent 6ba2768 commit 00cfab2
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/blank.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Publish PowerShell Module to PowerShell Gallery

on:
push:
branches:
- main
release:
types:
- published
workflow_dispatch:

jobs:
publish:
runs-on: windows-latest

steps:
# Checkout the repository
- name: Checkout code
uses: actions/checkout@v3

# Set up PowerShell environment
- name: Setup PowerShell
uses: actions/setup-powershell@v2
with:
pwsh-version: '7.x'

# Validate the module (ensure it loads correctly)
- name: Validate PowerShell Module
run: |
$manifest = Test-ModuleManifest -Path ./KubeTidy.psd1
Write-Host "Validated Module Version: $($manifest.Version)"
# Publish to PowerShell Gallery
- name: Publish to PowerShell Gallery
run: |
Install-Module -Name PowerShellGet -Force -AllowClobber
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
Publish-Module -Path ./KubeTidy -NuGetApiKey $env:PSGALLERY_API_KEY -Repository PSGallery
env:
PSGALLERY_API_KEY: ${{ secrets.PSGALLERY_API_KEY }}

0 comments on commit 00cfab2

Please sign in to comment.