-
Notifications
You must be signed in to change notification settings - Fork 305
44 lines (37 loc) · 1.24 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
name: CI
on:
create: # when tags are created
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
Build_Windows:
runs-on: windows-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 7.0.x
- name: Restore dependencies
run: dotnet restore src
- name: Build Project
run: dotnet build -c Release --no-restore src
- name: Build Packages
run: dotnet pack src/ImGui.NET -c Release --no-restore --no-build
- name: List Packages
run: ls -l bin\Release\ImGui.NET\
- name: Validate Generated Code
if: startsWith(github.ref, 'refs/tags/')
shell: bash
run: |
echo "Running CodeGenerator"
bin/Release/CodeGenerator/net7.0/CodeGenerator.exe "src/ImGui.NET/Generated"
git status -s | findstr . && echo "ERROR: CodeGenerator is not executed, please execute it." && exit 1 || exit 0
- name: Publish to nuget.org
if: startsWith(github.ref, 'refs/tags/')
run: dotnet nuget push bin\Release\ImGui.NET\*.nupkg -s https://api.nuget.org/v3/index.json --api-key ${{secrets.NUGET_KEY}}