Skip to content

Commit

Permalink
Publish PowerCommander to PowerShell Gallery
Browse files Browse the repository at this point in the history
  • Loading branch information
sk-keeper committed Sep 19, 2023
1 parent 87b7b61 commit 24942b1
Show file tree
Hide file tree
Showing 25 changed files with 3,679 additions and 3,564 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@
name: "Code Analysis"

on:
push:
branches: [ "master" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "master" ]
schedule:
- cron: '17 23 * * 3'

Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/power-commander.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Publish PowerCommander

on: [workflow_dispatch]

jobs:
build:
runs-on: windows-latest
environment: prod

steps:
- uses: actions/checkout@v2

- name: Load signing certificate
run: |
if (Test-Path -Path certificate.txt) { Remove-Item certificate.txt }
if (Test-Path -Path certificate.pfx) { Remove-Item certificate.pfx }
Set-Content -Path certificate.txt -Value '${{ secrets.PFX_CERT }}'
certutil -decode certificate.txt certificate.pfx
Remove-Item certificate.txt
shell: powershell

- name: Sign PowerShell scripts
working-directory: ./PowerCommander
run: |
$certPassword = ConvertTo-SecureString -String "${{ secrets.PFX_PASS }}" -AsPlainText -Force
$certData = Get-PfxData -FilePath "..\certificate.pfx" -Password $certPassword
$cert = $certData.EndEntityCertificates[0]
Set-AuthenticodeSignature -FilePath *.ps1 -Certificate $cert
Set-AuthenticodeSignature -FilePath *.ps1xml -Certificate $cert
Set-AuthenticodeSignature -FilePath PowerCommander.psd1 -Certificate $cert
Set-AuthenticodeSignature -FilePath PowerCommander.psm1 -Certificate $cert
shell: powershell

- name: Publish to PowerShell Gallery
run: |
Publish-Module -Path .\PowerCommander\ -NuGetApiKey "${{ secrets.POWERSHELL_PUBLISH_KEY }}"
shell: powershell
Loading

0 comments on commit 24942b1

Please sign in to comment.