-
Notifications
You must be signed in to change notification settings - Fork 4
147 lines (123 loc) · 4.25 KB
/
x-win.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
name: Experiment-Windows
on:
workflow_dispatch: # manually-triggered runs
permissions:
# only allowed to read source code (ref. https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs)
contents: read
concurrency:
# cancel pending runs when a PR gets updated
group: "${{ github.head_ref || github.run_id }}-${{ github.actor }}"
cancel-in-progress: true
jobs:
build:
name: "X-Win - ${{ matrix.name }}"
strategy:
matrix:
include:
#TODO(later)
#- name: "Ubuntu ARM64"
# os:
# - ARM64
# - linux
# - Ubuntu
# env:
# OS: "linux"
# NUGET_RID: "linux-arm64"
- name: "Ubuntu x64"
os: ubuntu-latest
# - X64
# - linux
# - Ubuntu
env:
OS: "linux"
NUGET_RID: "linux-x64"
#- name: "MacOS ARM64"
# os: macos-14
# env:
# OS: "apple"
# NUGET_RID: "osx"
- name: "Windows x64"
os: windows-latest
env:
OS: "windows"
NUGET_RID: "win-x64"
NUGET_PACK_DOTNET_LIB: "1"
runs-on: "${{ matrix.os }}"
defaults:
run:
shell: "${{ matrix.env.OS == 'windows' && 'pwsh' || 'bash' }}"
env:
DOTNET_NOLOGO: 1
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
VCPKG_DISABLE_METRICS: 1
NUGET_BASE_VERSION: "0.0"
ROYALVNC_BUILD_DEBUG: 0
SWIFT_VERSION: "6.0.2"
steps:
- name: checkout
uses: actions/checkout@v4
# setup build environment
- name: setup environment (Apple)
if: "success() && matrix.env.OS == 'apple'"
run: |
sudo xcode-select --switch /Applications/Xcode_16.0.app
- name: setup VC++ environment (Windows)
if: "success() && matrix.env.OS == 'windows'"
uses: compnerd/gha-setup-vsdevenv@v6
- name: setup Swift (Windows)
if: "success() && matrix.env.OS == 'windows'"
uses: compnerd/[email protected]
with:
branch: "swift-${{ env.SWIFT_VERSION }}-release"
tag: "${{ env.SWIFT_VERSION }}-RELEASE"
# build RoyalVNCKit
- name: build RoyalVNCKit
run: |
swift package clean --configuration release
swift build --configuration release
# .NET bindings and NuGet package artifacts
- name: build .NET bindings
run: |
dotnet build --configuration Release Bindings/dotnet/RoyalApps.RoyalVNCKit.sln
- name: create native NuGet package
if: "success() && matrix.env.NUGET_RID != ''"
env:
NUGET_VERSION: "${{ env.NUGET_BASE_VERSION }}.${{ github.run_number }}"
NUGET_RID: "${{ matrix.env.NUGET_RID }}"
NUGET_GIT_COMMIT: "${{ github.sha }}"
NUGET_SWIFT_RT_VERSION: "${{ env.SWIFT_VERSION }}"
run: |
pwsh Bindings/dotnet/nuget-pack-native.ps1
#- name: test AOT build and interop
# if: "success() && matrix.env.NUGET_RID != ''"
# env:
# NUGET_VERSION: "${{ env.NUGET_BASE_VERSION }}.${{ github.run_number }}"
# NUGET_RID: "${{ matrix.env.NUGET_RID }}"
# run: |
# pwsh Bindings/dotnet/nuget-test-aot.ps1
- name: create NuGet package
if: "success() && matrix.env.NUGET_PACK_DOTNET_LIB == '1'"
env:
NUGET_VERSION: "${{ env.NUGET_BASE_VERSION }}.${{ github.run_number }}"
NUGET_GIT_COMMIT: "${{ github.sha }}"
run: |
pwsh Bindings/dotnet/nuget-pack-dotnet.ps1
- name: publish native NuGet packages
if: "success() && matrix.env.NUGET_RID != ''"
uses: actions/upload-artifact@v4
with:
name: "RoyalApps.RoyalVNCKit.native.${{ matrix.env.NUGET_RID }}"
retention-days: 5
if-no-files-found: "error"
path: |
Bindings/dotnet/RoyalApps.RoyalVNCKit.native/bin/Release/RoyalApps.*.nupkg
- name: publish NuGet package
if: "success() && matrix.env.NUGET_PACK_DOTNET_LIB == '1'"
uses: actions/upload-artifact@v4
with:
name: "RoyalApps.RoyalVNCKit"
retention-days: 5
if-no-files-found: "error"
path: |
Bindings/dotnet/RoyalApps.RoyalVNCKit/bin/Release/RoyalApps.RoyalVNCKit.*.nupkg