Skip to content

Commit

Permalink
Add dispatch and pr triggers to release workflow (#207)
Browse files Browse the repository at this point in the history
  • Loading branch information
tristanlabelle authored Jul 22, 2024
1 parent dc9e125 commit 304e3f9
Showing 1 changed file with 23 additions and 5 deletions.
28 changes: 23 additions & 5 deletions .github/workflows/release-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 304e3f9

Please sign in to comment.