-
Notifications
You must be signed in to change notification settings - Fork 20
103 lines (100 loc) · 3.87 KB
/
force_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
name: Force build
on:
workflow_dispatch:
inputs:
publishEnabled:
description: "Publish to Nuget.org"
type: boolean
required: false
default: false
env:
filePath: ${{ 'vk.xml' }}
fileTmpPath: ${{ 'vk.xml_tmp' }}
basePath: ${{ 'KhronosRegistry' }}
sourceUrl: ${{ 'https://raw.githubusercontent.com/KhronosGroup/Vulkan-Docs/main/xml/vk.xml' }}
selfUrl: ${{ 'https://raw.githubusercontent.com/EvergineTeam/Vulkan.NET/master/KhronosRegistry/vk.xml' }}
nugetOutputPath: ${{ 'nupkgs' }}
jobs:
download:
runs-on: windows-latest
outputs:
output1: ${{ steps.fileHash.outputs.hash1 }}
output2: ${{ steps.fileHash.outputs.hash2 }}
output3: ${{ steps.fileHash.outputs.date }}
steps:
- name: download target file
uses: carlosperate/[email protected]
with:
# URL of the file to download
file-url: ${{ env.sourceUrl }}
file-name: ${{ env.filePath }}
- name: download our file
uses: carlosperate/[email protected]
with:
# URL of the file to download
file-url: ${{ env.selfUrl }}
file-name: ${{ env.fileTmpPath }}
- name: Get file hash
id: fileHash
run: |
echo "::set-output name=hash1::${{ hashFiles('vk.xml') }}"
echo "::set-output name=hash2::${{ hashFiles('vk.xml_tmp') }}"
echo "::set-output name=date::$(date +'%Y.%m.%d')"
build_and_publish:
needs: [download]
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x
- uses: nuget/setup-nuget@v2
with:
nuget-version: "6.x"
- name: remove old file
run: |
cd ${{ env.basePath }}
rm ${{ env.filePath }}
ls
- name: download target file
uses: carlosperate/[email protected]
with:
# URL of the file to download
file-url: ${{ env.sourceUrl }}
file-name: ${{ env.filePath }}
location: ${{ env.basePath }}/
- name: Generate Bindings
id: build_bindings
run: powershell ./Generate-Bindings.ps1
- name: Commit if update
if: ${{ needs.download.outputs.output1 != needs.download.outputs.output2 }}
uses: EndBug/add-and-commit@v9
with:
message: Updating new Vulkan version
- name: Generate NuGet packages
id: build_nugets
run: powershell ./Generate-NuGets.ps1 -Version ${{ needs.download.outputs.output3 }}.${{ github.run_number }} -outputfolder ${{ env.nugetOutputPath }}
- name: Publish NuGet
if: ${{ success() && github.event.inputs.publishEnabled == 'true' }}
env:
token: ${{secrets.EVERGINE_NUGETORG_TOKEN}}
run: |
cd ${{ env.nugetOutputPath }}
ls *.nupkg
dotnet nuget push "**/*.nupkg" --skip-duplicate --no-symbols -k "$env:token" -s https://api.nuget.org/v3/index.json
- name: SendGrid Mail Action
if: ${{ failure() }}
uses: mmichailidis/[email protected]
with:
# The token for sendgrid
sendgrid-token: ${{ secrets.WAVE_SENDGRID_TOKEN }}
# List of emails separated by comma that the email will go
mail: ${{ secrets.EVERGINE_EMAILREPORT_LIST }}
# The email that will be shown as sender
from: ${{ secrets.EVERGINE_EMAIL }}
# The subject of the email
subject: Vulkan Update NuGet has failed
# Defines if it should be one email with multiple address or multiple emails with a single address
individual: false
# The body of the mail. The placeholders that can be used are $EVENT$, $ISSUE$, $ACTION$
text: something when wrong when updating new vk.xml file from KhronosRegistry