diff --git a/.github/workflows/release-publish.yml b/.github/workflows/release-publish.yml index 29743a58..807ab09e 100644 --- a/.github/workflows/release-publish.yml +++ b/.github/workflows/release-publish.yml @@ -4,6 +4,22 @@ on: release: types: - published + workflow_dispatch: + inputs: + version: + description: Version number + required: true + type: string + publish: + description: Publish to NuGet + required: false + default: false + type: boolean + pull_request: + branches: + - main + paths: + - .github/workflows/release-publish.yml jobs: build-and-publish: @@ -34,16 +50,18 @@ jobs: run: cmake --build --preset release - name: Create NuGet Package + working-directory: Generator shell: pwsh run: | - $Version = "${{ github.event.release.tag_name }}" - if ($Version.StartsWith("v")) $Version = $Version.Substring(1) - & Generator\Create-NuGetPackage.ps1 ` - -NativeExe "build\release\bin\SwiftWinRT.exe" ` + $Version = "${{ github.event.release.tag_name && inputs.version }}" + if ($Version.StartsWith("v")) { $Version = $Version.Substring(1) } + & .\Create-NuGetPackage.ps1 ` + -NativeExe "build\release\Sources\SwiftWinRT\SwiftWinRT.exe" ` -Version $Version ` - -OutputPath "SwiftWinRT.nupkg" + -OutputPath "${{ github.workspace }}\SwiftWinRT.nupkg" - name: Add Release Asset + if: github.event_name == 'release' uses: softprops/action-gh-release@v2 with: files: SwiftWinRT.nupkg