Skip to content

Ignore invalid sub reg keys (#18) #27

Ignore invalid sub reg keys (#18)

Ignore invalid sub reg keys (#18) #27

Workflow file for this run

name: Release packages
on:
push:
tags:
- "v*"
jobs:
publish:
runs-on: windows-latest
steps:
- uses: olegtarasov/[email protected]
id: tagName
with:
tagRegex: "v(.*)"
tagRegexGroup: 1
- uses: actions/checkout@v4
- name: Extract release notes
run: |
git log --pretty=format:'%d %s' ${GITHUB_REF} | perl -pe 's| \(.*tag: v(\d+.\d+.\d+(-preview\d{3})?)(, .*?)*\)|\n## \1\n|g' > ./RELEASE-NOTES.txt; if (-! $?) { exit 1 } else { exit $LastExitCode }
- name: Setup .NET SDKs
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
8.0.x
include-prerelease: true
- name: Decode the Pfx
run: |
$signing_keys_payload = [System.Convert]::FromBase64String("${{ secrets.SIGNING_KEY }}")
$currentDirectory = Get-Location
$certificatePath = Join-Path -Path $currentDirectory -ChildPath "sgKey.snk"
[IO.File]::WriteAllBytes("$certificatePath", $signing_keys_payload)
if (-! $?) { exit 1 } else { exit $LastExitCode }
- name: Build
run: dotnet build -p:Configuration=Release -p:Version="$env:TAG_NAME"
env:
TAG_NAME: ${{ steps.tagName.outputs.tag }}
- name: Test
run: dotnet test -p:Configuration=Release --filter TestCategory!=Integration --no-build
- name: Pack
run: dotnet pack -p:Configuration=Release -o "$(Join-Path $(Get-Location) nuget)" /p:Version="$env:TAG_NAME" --no-build
env:
TAG_NAME: ${{ steps.tagName.outputs.tag }}
- name: Attach nuget packages to Github releases
uses: softprops/action-gh-release@v2
with:
files: "./nuget/*.nupkg"
prerelease: ${{ contains(steps.tagName.outputs.tag, '-') }}
- name: Push packages to Nuget registry
run: dotnet nuget push $(Get-ChildItem -Path ./nuget -Filter "*.nupkg").FullName --source "https://api.nuget.org/v3/index.json" --api-key "$env:NUGET_API_KEY" --skip-duplicate
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}