@@ -2,11 +2,8 @@ name: CI
22on : [ push, pull_request ]
33jobs :
44 build-java :
5- strategy :
6- matrix :
7- os : [ ubuntu-latest, macos-latest ]
85 name : Build Java
9- runs-on : ${{ matrix.os }}
6+ runs-on : ubuntu-latest
107 steps :
118 - name : Checkout Repository
129 uses : actions/checkout@v3
3330 imgui-lwjgl3/build/libs/*.jar
3431
3532 build-natives :
33+ name : Build Native (${{ matrix.type }}${{ matrix.freetype && ', freetype' || '' }})
3634 strategy :
3735 matrix :
3836 os : [ ubuntu-latest, macos-latest ]
5250 type : windows
5351 - os : macos-latest
5452 type : linux
55- name : Build Native (${{ matrix.type }}${{ matrix.freetype && ', freetype' || '' }})
5653 runs-on : ${{ matrix.os }}
5754 steps :
5855 - name : Checkout Repository and Submodules
@@ -113,25 +110,27 @@ jobs:
113110 with :
114111 path : /tmp/artifacts
115112
116- - name : Equal Artifacts
117- id : equal-artifacts
113+ # Job compares sha1 hash of the imgui-binding/src/main directory.
114+ # If there are any changes, then we update native libraries.
115+ # We do not rely on git in terms of comparing binaries,
116+ # since DLL files will always have versioning difference.
117+ - name : Compare Binding Hash
118+ id : cmp-binding-hash
118119 continue-on-error : true
119120 run : |
120- python3 buildSrc/scripts/equal_file_size.py /tmp/artifacts/native-libraries/imgui-java64.dll bin/imgui-java64.dll
121- python3 buildSrc/scripts/equal_file_size.py /tmp/artifacts/native-libraries/libimgui-java64.dylib bin/libimgui-java64.dylib
122- python3 buildSrc/scripts/equal_file_size.py /tmp/artifacts/native-libraries/libimgui-java64.so bin/libimgui-java64.so
123- python3 buildSrc/scripts/equal_file_size.py /tmp/artifacts/native-libraries-with-freetype/imgui-java64.dll bin/freetype/imgui-java64.dll
124- python3 buildSrc/scripts/equal_file_size.py /tmp/artifacts/native-libraries-with-freetype/libimgui-java64.dylib bin/freetype/libimgui-java64.dylib
125- python3 buildSrc/scripts/equal_file_size.py /tmp/artifacts/native-libraries-with-freetype/libimgui-java64.so bin/freetype/libimgui-java64.so
121+ touch bin/binding.sha1
122+ cat bin/binding.sha1 > /tmp/hash
123+ find imgui-binding/src/main -type f -print0 | xargs -0 sha1sum > bin/binding.sha1
124+ cmp /tmp/hash bin/binding.sha1
126125
127126 - name : Update
128- if : steps.equal-artifacts .outcome != 'success'
127+ if : steps.cmp-binding-hash .outcome != 'success'
129128 run : |
130129 mv /tmp/artifacts/native-libraries/* bin/
131130 mv /tmp/artifacts/native-libraries-with-freetype/* bin/freetype/
132131
133132 - name : Commit
134- if : steps.equal-artifacts .outcome != 'success'
133+ if : steps.cmp-binding-hash .outcome != 'success'
135134 uses : EndBug/add-and-commit@v9
136135 with :
137136 default_author : github_actions
0 commit comments