Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dispatch and pr triggers to release workflow #207

Merged
merged 3 commits into from
Jul 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading