-
Notifications
You must be signed in to change notification settings - Fork 12
28 lines (24 loc) · 1.16 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
name: release
on:
workflow_dispatch:
jobs:
release:
runs-on: windows-2022
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Sign and publish
env:
NUGET_KEY: ${{ secrets.PS_GALLERY_KEY }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
SIGNING_CERTIFICATE: ${{ secrets.SIGNING_CERTIFICATE }}
shell: pwsh
run: |
Install-Module -Force -Name 'powershell-yaml'
$certPath = Join-Path -Path $PSScriptRoot -ChildPath "code_signing.pfx"
Set-Content -Value $([System.Convert]::FromBase64String($env:SIGNING_CERTIFICATE)) -Path $certPath -AsByteStream
$cert = Import-PfxCertificate -FilePath $certPath -Password ($env:SIGNING_PASSWORD | ConvertTo-SecureString -AsPlainText -Force) -CertStoreLocation Cert:\CurrentUser\My
Get-ChildItem src -Recurse -Force -Filter *.ps* | Set-AuthenticodeSignature -Certificate $cert -TimestampServer 'http://timestamp.digicert.com'
Copy-Item .\src\ -Recurse -Destination .\SentinelARConverter\ -Force
Publish-Module -Path .\SentinelARConverter\ -NuGetApiKey $env:NUGET_KEY