-
Notifications
You must be signed in to change notification settings - Fork 6
110 lines (84 loc) · 2.67 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
101
102
103
104
105
106
107
108
109
110
name: Build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
release:
types: [ published ]
env:
BuildVersion: "CI.${{ github.run_id }}"
BuildBranch: "${{ github.ref }}"
BuildParameters: "/v:Minimal /p:Configuration=Release Eto.Veldrid.sln"
jobs:
build-windows:
runs-on: windows-latest
env:
PlatformBuildParameters: /p:Platform=Windows
steps:
- uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Install macos workload
run: dotnet workload install macos
- uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Build
run: dotnet build ${{ env.PlatformBuildParameters }} ${{ env.BuildParameters }}
- name: Pack
run: dotnet pack ${{ env.PlatformBuildParameters }} ${{ env.BuildParameters }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: nuget
path: artifacts/nuget/**/*.nupkg
build-mac:
runs-on: macos-latest
env:
PlatformBuildParameters: /p:Platform=Mac
steps:
- uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Install macos workload
run: dotnet workload install macos
- name: Setup XCode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Build
run: dotnet build ${{ env.PlatformBuildParameters }} ${{ env.BuildParameters }}
- name: Pack
run: dotnet pack ${{ env.PlatformBuildParameters }} ${{ env.BuildParameters }}
# - name: Upload artifacts
# uses: actions/upload-artifact@v4
# with:
# name: nuget
# path: artifacts/nuget/**/Eto.Veldrid.XamMac2.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
- 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}}