-
Notifications
You must be signed in to change notification settings - Fork 2
70 lines (61 loc) · 1.82 KB
/
release-publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: Release
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:
name: Build and Publish
runs-on: windows-2022
timeout-minutes: 15
steps:
- uses: actions/checkout@v3
- name: Setup Visual Studio Development Environment
uses: compnerd/gha-setup-vsdevenv@main
- name: Install Swift
uses: compnerd/gha-setup-swift@81f383b35a86e6e966de139be25b451d4f7dd953 # The next main commit breaks our %Path%
with:
branch: swift-5.10.1-release
tag: 5.10.1-RELEASE
- name: CMake Configure
working-directory: Generator
shell: pwsh
run: cmake --preset release
- name: CMake Build
working-directory: Generator
shell: pwsh
run: cmake --build --preset release
- name: Create NuGet Package
working-directory: Generator
shell: pwsh
run: |
$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 "${{ github.workspace }}\SwiftWinRT.nupkg"
- name: Add Release Asset
if: github.event_name == 'release'
uses: softprops/action-gh-release@v2
with:
files: SwiftWinRT.nupkg
token: ${{ secrets.GITHUB_TOKEN }}
release: ${{ github.event.release.id }}
body: SwiftWinRT NuGet package