Skip to content

Release

Release #470

Workflow file for this run

name: Release
on:
workflow_run:
workflows: ["Package"]
types:
- completed
permissions:
issues: write
jobs:
releaseInfo:
name: Check for Release
runs-on: windows-latest
outputs:
IS_RELEASE: ${{ steps.releaseInfoStep.outputs.isRelease}}
if: github.event.workflow_run.conclusion == 'success'
steps:
- name: Download Release Info
uses: dawidd6/action-download-artifact@v6
with:
run_id: ${{ github.event.workflow_run.id }}
name: release-info
- name: Check if workflow is release
id: releaseInfoStep
shell: pwsh
run: |
$isRelease = Get-Content -Path release-info.txt
if ($isRelease -eq 'true') {
echo "isRelease=true" >> $env:GITHUB_OUTPUT
} else {
echo "isRelease=false" >> $env:GITHUB_OUTPUT
}
deploy:
name: "Deploy Packages to Nuget"
needs: [releaseInfo]
if: needs.releaseInfo.outputs.IS_RELEASE == 'true'
runs-on: ubuntu-latest
steps:
- name: Download and Extract Artifacts from build
uses: dawidd6/action-download-artifact@v6
with:
run_id: ${{ github.event.workflow_run.id }}
name: Signed
path: artifacts
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
- name: Approve
uses: trstringer/manual-approval@v1
with:
secret: ${{ github.TOKEN }}
approvers: twsouthwick,tomjebo,mikeebowen
minimum-approvals: 2
issue-title: "Approval for publishing to Nuget.org"
issue-body: "Please approve or deny the deployment to Nuget.org"
exclude-workflow-initiator-as-approver: false
additional-approved-words: ''
additional-denied-words: ''
- name: Publish NuGet package
shell: pwsh
run: |
foreach($file in (Get-ChildItem "${{ github.workspace }}/artifacts" -Recurse -Include *.nupkg)) {
dotnet nuget push $file --api-key "${{ secrets.NUGET_APIKEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate
}