Skip to content

Force build

Force build #30

Workflow file for this run

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@v2
- uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.x
- uses: nuget/setup-nuget@v1
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