CD Extensions #399
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CD Extensions | |
# This CD builds and publish what is currently on the repo. | |
# Addionally, periodically updates the reference to latest Imgui nuget and try to publish a new ones. | |
on: | |
workflow_dispatch: | |
inputs: | |
publishEnabled: | |
description: "Publish to Nuget.org" | |
type: boolean | |
required: false | |
default: false | |
schedule: | |
- cron: "23 20 * * *" # Executed every day at 23:20 | |
env: | |
nugetsPath: "nupkgs" | |
imguiNuget: "Evergine.Bindings.Imgui" | |
imguizmoPath: "./Generator/Evergine.Bindings.Imguizmo" | |
imnodesPath: "./Generator/Evergine.Bindings.Imnodes" | |
implotPath: "./Generator/Evergine.Bindings.Implot" | |
jobs: | |
build_publish_extensions_win: | |
name: Generate extensions nugets (windows only) | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.x | |
- name: Update nugets | |
shell: pwsh | |
run: | | |
dotnet add ${{ env.imguizmoPath }} package ${{ env.imguiNuget }} | |
dotnet add ${{ env.imnodesPath }} package ${{ env.imguiNuget }} | |
dotnet add ${{ env.implotPath }} package ${{ env.imguiNuget }} | |
# check if there is a new nuget of Imgui | |
- name: Verify Imgui nuget changes | |
id: verify-imgui-nuget | |
shell: pwsh | |
run: | | |
.\scripts\verify-changes.ps1 | |
# TODO move build native steps to different jobs, commit, and then continue with Imgui on Windows | |
- uses: ./.github/actions/build-native-win | |
if: ${{ success() && (github.event_name != 'schedule' || steps.verify-imgui-nuget.outputs.files_changed == 'true') }} | |
with: | |
Target: Extensions | |
NugetsPath: ${{ env.nugetsPath }} | |
- uses: ./.github/actions/generate-bindings-nugets | |
if: ${{ success() && (github.event_name != 'schedule' || steps.verify-imgui-nuget.outputs.files_changed == 'true') }} | |
with: | |
ImX: Imguizmo | |
NugetsPath: ${{ env.nugetsPath }} | |
- uses: ./.github/actions/generate-bindings-nugets | |
if: ${{ success() && (github.event_name != 'schedule' || steps.verify-imgui-nuget.outputs.files_changed == 'true') }} | |
with: | |
ImX: Imnodes | |
NugetsPath: ${{ env.nugetsPath }} | |
- uses: ./.github/actions/generate-bindings-nugets | |
if: ${{ success() && (github.event_name != 'schedule' || steps.verify-imgui-nuget.outputs.files_changed == 'true') }} | |
with: | |
ImX: Implot | |
NugetsPath: ${{ env.nugetsPath }} | |
- name: Verify changes | |
id: verify-changed-files | |
if: ${{ success() && (github.event_name != 'schedule' || steps.verify-imgui-nuget.outputs.files_changed == 'true') }} | |
shell: pwsh | |
run: | | |
.\scripts\verify-changes.ps1 | |
- uses: ./.github/actions/publish-nugets | |
if: ${{ success() && ((github.event_name != 'schedule' && github.event.inputs.publishEnabled == 'true') || (github.event_name == 'schedule' && steps.verify-changed-files.outputs.files_changed == 'true')) }} | |
with: | |
NugetsPath: ${{ env.nugetsPath }} | |
Token: ${{ secrets.EVERGINE_NUGETORG_TOKEN }} | |
- name: Commit if appropiate | |
if: ${{ success() && steps.verify-changed-files.outputs.files_changed == 'true' }} # don't commit if only dlls have been changed | |
uses: EndBug/add-and-commit@v9 | |
with: | |
message: Updating nugets | |
committer_name: GitHub Actions | |
committer_email: 41898282+github-actions[bot]@users.noreply.github.com |