-
Notifications
You must be signed in to change notification settings - Fork 6
100 lines (78 loc) · 2.68 KB
/
build.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
name: Build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
release:
types: [ published ]
env:
BuildVersion: "CI.${{ github.run_id }}"
BuildBranch: "${{ github.ref }}"
BuildParameters: "build -m:1 -c Release"
PackParameters: "pack --no-build --no-restore -m:1 -c Release"
DotNetVersion: '8.0.x'
jobs:
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DotNetVersion }}
- name: Build
run: |
dotnet build ${{ env.BuildParameters }} test\TestEtoVeldrid.Wpf\TestEtoVeldrid.Wpf.csproj
dotnet build ${{ env.BuildParameters }} test\TestEtoVeldrid.WinForms\TestEtoVeldrid.WinForms.csproj
- name: Pack
run: |
dotnet pack ${{ env.PackParameters }} src\Eto.Veldrid.Wpf\Eto.Veldrid.Wpf.csproj
dotnet pack ${{ env.PackParameters }} src\Eto.Veldrid.WinForms\Eto.Veldrid.WinForms.csproj
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: nuget
path: |
artifacts/nuget/**/Eto.Veldrid.Wpf.*.nupkg
artifacts/nuget/**/Eto.Veldrid.WinForms.*.nupkg
build-mac:
runs-on: macos-latest
env:
PlatformBuildParameters: /p:Platform=Mac Eto.Veldrid.sln
steps:
- uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DotNetVersion }}
- name: Setup XCode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Install macos workload
run: dotnet workload install macos
- name: Build
run: dotnet build ${{ env.BuildParameters }} ${{ env.PlatformBuildParameters }}
- name: Pack
run: dotnet pack ${{ env.PackParameters }} ${{ env.PlatformBuildParameters }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: nuget
path: artifacts/nuget/**/*.nupkg
publish:
needs: [ build-windows, build-mac ]
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DotNetVersion }}
- name: Download NuGet Packages
uses: actions/download-artifact@v4
with:
name: nuget
- name: Push packages
run: dotnet nuget push './nuget/**/*.nupkg' --skip-duplicate -s https://api.nuget.org/v3/index.json -k ${{secrets.NUGET_API_KEY}}