Skip to content

release

release #422

Workflow file for this run

# This workflow generates releases for tagged versions
# It runs on a schedule because we can't trigger from a tag being created in a remote repository
name: release
on:
push:
pull_request:
workflow_run:
# Use a workflow as a trigger of scheduled builds. Forked repositories can disable scheduled builds by disabling
# "scheduled" workflow, while maintaining ability to perform local CI builds.
workflows:
- scheduled
types:
- requested
jobs:
Linux:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
branch:
- master
- docking
steps:
# Checkout both repositories
- uses: actions/checkout@v4
id: dear_bindings_checkout
with:
ref: main
repository: dearimgui/dear_bindings
fetch-depth: 0
- uses: actions/checkout@v4
id: imgui_checkout
with:
path: imgui
repository: ocornut/imgui
ref: ${{ matrix.branch }}
fetch-depth: 0
# Get the latest tags from the repository
- name: get_tags
run: |
# We exclude DearBindings_* here to avoid picking up our own release tags
echo "DEAR_BINDINGS_TAG=$(git describe --tags --abbrev=0 --exclude DearBindings_*)" >> $GITHUB_ENV
cd imgui
echo "IMGUI_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
# Set our release tag
- name: set_release_tag
run: echo "RELEASE_TAG=DearBindings_${{ env.DEAR_BINDINGS_TAG }}_ImGui_${{ env.IMGUI_TAG }}" >> $GITHUB_ENV
# Check if this tag already exists
- name: check_release_tag
run: |
if [ $(git tag -l "${RELEASE_TAG}") ]; then
echo "Release tag already exists"
echo "DO_RELEASE=0" >> $GITHUB_ENV
else
echo "Release tag does not exist, preparing new release"
echo "DO_RELEASE=1" >> $GITHUB_ENV
fi
# Sync to those tags
- uses: actions/checkout@v4
id: dear_bindings_tag_checkout
if: ${{ env.DO_RELEASE == '1' }}
with:
repository: dearimgui/dear_bindings
ref: ${{ env.DEAR_BINDINGS_TAG }}
fetch-depth: 1
- uses: actions/checkout@v4
id: imgui_tag_checkout
if: ${{ env.DO_RELEASE == '1' }}
with:
path: imgui
repository: ocornut/imgui
ref: ${{ env.IMGUI_TAG }}
fetch-depth: 1
- name: install_dependencies
if: ${{ env.DO_RELEASE == '1' }}
run: |
sudo pip3 install ply
- name: generate_dcimgui
if: ${{ env.DO_RELEASE == '1' }}
run: python3 dear_bindings.py --output dcimgui --generateunformattedfunctions imgui/imgui.h
- name: generate_dcimgui_nogeneratedefaultargfunctions
if: ${{ env.DO_RELEASE == '1' }}
run: python3 dear_bindings.py --output dcimgui_nodefaultargfunctions --nogeneratedefaultargfunctions --generateunformattedfunctions imgui/imgui.h
- name: generate_dcimgui_internal
if: ${{ env.DO_RELEASE == '1' }}
run: python3 dear_bindings.py --output dcimgui_internal --generateunformattedfunctions --include imgui/imgui.h imgui/imgui_internal.h
- name: generate_dcimgui_nodefaultargfunctions_internal
if: ${{ env.DO_RELEASE == '1' }}
run: python3 dear_bindings.py --output dcimgui_nodefaultargfunctions_internal --nogeneratedefaultargfunctions --generateunformattedfunctions --include imgui/imgui.h imgui/imgui_internal.h
- name: generate_dcimgui_backends
if: ${{ env.DO_RELEASE == '1' }}
run: |
mkdir backends
python3 dear_bindings.py --backend --include imgui/imgui.h --output backends/dcimgui_impl_allegro5 imgui/backends/imgui_impl_allegro5.h
python3 dear_bindings.py --backend --include imgui/imgui.h --output backends/dcimgui_impl_android imgui/backends/imgui_impl_android.h
python3 dear_bindings.py --backend --include imgui/imgui.h --output backends/dcimgui_impl_dx9 imgui/backends/imgui_impl_dx9.h
python3 dear_bindings.py --backend --include imgui/imgui.h --output backends/dcimgui_impl_dx10 imgui/backends/imgui_impl_dx10.h
python3 dear_bindings.py --backend --include imgui/imgui.h --output backends/dcimgui_impl_dx11 imgui/backends/imgui_impl_dx11.h
python3 dear_bindings.py --backend --include imgui/imgui.h --output backends/dcimgui_impl_dx12 imgui/backends/imgui_impl_dx12.h
python3 dear_bindings.py --backend --include imgui/imgui.h --output backends/dcimgui_impl_glfw imgui/backends/imgui_impl_glfw.h
python3 dear_bindings.py --backend --include imgui/imgui.h --output backends/dcimgui_impl_glut imgui/backends/imgui_impl_glut.h
python3 dear_bindings.py --backend --include imgui/imgui.h --output backends/dcimgui_impl_null imgui/backends/imgui_impl_null.h
python3 dear_bindings.py --backend --include imgui/imgui.h --output backends/dcimgui_impl_opengl2 imgui/backends/imgui_impl_opengl2.h
python3 dear_bindings.py --backend --include imgui/imgui.h --output backends/dcimgui_impl_opengl3 imgui/backends/imgui_impl_opengl3.h
python3 dear_bindings.py --backend --include imgui/imgui.h --output backends/dcimgui_impl_sdl2 imgui/backends/imgui_impl_sdl2.h
python3 dear_bindings.py --backend --include imgui/imgui.h --output backends/dcimgui_impl_sdlrenderer2 imgui/backends/imgui_impl_sdlrenderer2.h
python3 dear_bindings.py --backend --include imgui/imgui.h --output backends/dcimgui_impl_sdl3 imgui/backends/imgui_impl_sdl3.h
python3 dear_bindings.py --backend --include imgui/imgui.h --output backends/dcimgui_impl_sdlgpu3 imgui/backends/imgui_impl_sdlgpu3.h
python3 dear_bindings.py --backend --include imgui/imgui.h --output backends/dcimgui_impl_sdlrenderer3 imgui/backends/imgui_impl_sdlrenderer3.h
python3 dear_bindings.py --backend --include imgui/imgui.h --output backends/dcimgui_impl_vulkan imgui/backends/imgui_impl_vulkan.h
python3 dear_bindings.py --backend --include imgui/imgui.h --output backends/dcimgui_impl_wgpu imgui/backends/imgui_impl_wgpu.h
python3 dear_bindings.py --backend --include imgui/imgui.h --output backends/dcimgui_impl_win32 imgui/backends/imgui_impl_win32.h
- name: Copy license
if: ${{ env.DO_RELEASE == '1' }}
run: |
cp imgui/LICENSE.txt LICENSE.txt
- name: Generate ZIP file
if: ${{ env.DO_RELEASE == '1' }}
run: |
echo Zipping to ${{ env.RELEASE_TAG }}.zip
zip ${{ env.RELEASE_TAG }}.zip dcimgui.* dcimgui_internal.* dcimgui_nodefaultargfunctions.* dcimgui_nodefaultargfunctions_internal.* backends/* LICENSE.txt
- name: Release
uses: softprops/action-gh-release@v2
if: ${{ env.DO_RELEASE == '1' }}
with:
# name: dear_bindings_${{ matrix.branch }}_${{ matrix.compiler }}_${{ matrix.flag_nogeneratedefaultargfunctions }}
# tag_name: dear_bindings_${{ matrix.branch }}_${{ matrix.compiler }}_${{ matrix.flag_nogeneratedefaultargfunctions }}_${{ steps.dear_bindings_checkout.outputs.commit }}_${{ steps.imgui_checkout.outputs.commit }}
tag_name: ${{ env.RELEASE_TAG }}
# body_path: docs/Changelog.txt
body: This release contains pre-generated binding files generated using Dear Bindings ${{ env.DEAR_BINDINGS_TAG }} for the Dear ImGui ${{ matrix.branch }} branch ${{ env.IMGUI_TAG }}. Files with names containing _nodefaultargfunctions have default argument function generation disabled. The zip file is simply a compressed version of the separate files for easier downloading.
files: |
dcimgui.*
dcimgui_internal.*
dcimgui_nodefaultargfunctions.*
dcimgui_nodefaultargfunctions_internal.*
backends/dcimgui_impl_*.cpp
backends/dcimgui_impl_*.h
backends/dcimgui_impl_allegro5.json
backends/dcimgui_impl_android.json
backends/dcimgui_impl_dx9.json
backends/dcimgui_impl_dx10.json
backends/dcimgui_impl_dx11.json
backends/dcimgui_impl_dx12.json
backends/dcimgui_impl_glut.json
backends/dcimgui_impl_null.json
backends/dcimgui_impl_opengl2.json
backends/dcimgui_impl_opengl3.json
backends/dcimgui_impl_sdl2.json
backends/dcimgui_impl_sdlrenderer2.json
backends/dcimgui_impl_sdl3.json
backends/dcimgui_impl_sdlgpu3.json
backends/dcimgui_impl_sdlrenderer3.json
backends/dcimgui_impl_vulkan.json
backends/dcimgui_impl_wgpu.json
backends/dcimgui_impl_win32.json
LICENSE.txt
${{ env.RELEASE_TAG }}.zip