Skip to content

Update README.md

Update README.md #3

Workflow file for this run

name: CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
filePath: ${{ 'xr.xml' }}
fileTmpPath: ${{ 'xr.xml_tmp' }}
basePath: ${{ 'KhronosRegistry' }}
sourceUrl: ${{ 'https://raw.githubusercontent.com/KhronosGroup/OpenXR-Docs/master/specification/registry/xr.xml' }}
selfUrl: ${{ 'https://raw.githubusercontent.com/EvergineTeam/OpenXR.NET/main/KhronosRegistry/xr.xml' }}
nugetOutputPath: ${{ 'nupkgs' }}
jobs:
download:
runs-on: windows-latest
outputs:
output1: ${{ steps.xr.outputs.hash1 }}
output2: ${{ steps.xr.outputs.hash2 }}
output3: ${{ steps.xr.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 hash from saved xr
id: xr
run: |
echo "::set-output name=hash1::${{ hashFiles('xr.xml') }}"
echo "::set-output name=hash2::${{ hashFiles('xr.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 OpenXR 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: 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: Open XR 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 xr.xml file from KhronosRegistry