Update nuget workflow to allow manual release

This commit is contained in:
mio
2025-02-13 23:39:45 +08:00
parent a912fed662
commit 3e99b859a8

View File

@@ -12,6 +12,16 @@ on:
- "AUTHORS.TXT"
- "CHANGELOG"
- "COPYING"
workflow_dispatch:
inputs:
forceRelease:
description: 'Force release'
required: false
default: ''
type: choice
options:
- '0'
- '1'
permissions:
packages: write
@@ -425,13 +435,15 @@ jobs:
with:
path: ${{ github.workspace }}/bindings/dotnet/UnicornEngine/bin/Release/UnicornEngine.Unicorn.*.nupkg
# We always reach billing limit, allow it fails
- name: 📦 Publish to Github Packages
if: startsWith(github.ref, 'refs/tags') && !startsWith(github.ref, 'refs/tags/v')
if: (inputs.forceRelease != '' && inputs.forceRelease == 1) || (startsWith(github.ref, 'refs/tags') && !startsWith(github.ref, 'refs/tags/v'))
continue-on-error: true
working-directory: bindings/dotnet/UnicornEngine
run: dotnet nuget push "bin/Release/UnicornEngine.Unicorn.*.nupkg" --source "github" --api-key "${{ secrets.GHPR_TOKEN }}"
- name: 📦 Publish Nuget package
if: startsWith(github.ref, 'refs/tags') && !startsWith(github.ref, 'refs/tags/v')
if: (inputs.forceRelease != '' && inputs.forceRelease == 1) || (startsWith(github.ref, 'refs/tags') && !startsWith(github.ref, 'refs/tags/v'))
working-directory: bindings/dotnet/UnicornEngine
run: dotnet nuget push "bin/Release/UnicornEngine.Unicorn.*.nupkg" -k "$NUGET_AUTH_TOKEN" -s https://api.nuget.org/v3/index.json
env: