@@ -2,11 +2,8 @@ name: CI
2
2
on : [ push, pull_request ]
3
3
jobs :
4
4
build-java :
5
- strategy :
6
- matrix :
7
- os : [ ubuntu-latest, macos-latest ]
8
5
name : Build Java
9
- runs-on : ${{ matrix.os }}
6
+ runs-on : ubuntu-latest
10
7
steps :
11
8
- name : Checkout Repository
12
9
uses : actions/checkout@v3
33
30
imgui-lwjgl3/build/libs/*.jar
34
31
35
32
build-natives :
33
+ name : Build Native (${{ matrix.type }}${{ matrix.freetype && ', freetype' || '' }})
36
34
strategy :
37
35
matrix :
38
36
os : [ ubuntu-latest, macos-latest ]
52
50
type : windows
53
51
- os : macos-latest
54
52
type : linux
55
- name : Build Native (${{ matrix.type }}${{ matrix.freetype && ', freetype' || '' }})
56
53
runs-on : ${{ matrix.os }}
57
54
steps :
58
55
- name : Checkout Repository and Submodules
@@ -113,25 +110,27 @@ jobs:
113
110
with :
114
111
path : /tmp/artifacts
115
112
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
118
119
continue-on-error : true
119
120
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
126
125
127
126
- name : Update
128
- if : steps.equal-artifacts .outcome != 'success'
127
+ if : steps.cmp-binding-hash .outcome != 'success'
129
128
run : |
130
129
mv /tmp/artifacts/native-libraries/* bin/
131
130
mv /tmp/artifacts/native-libraries-with-freetype/* bin/freetype/
132
131
133
132
- name : Commit
134
- if : steps.equal-artifacts .outcome != 'success'
133
+ if : steps.cmp-binding-hash .outcome != 'success'
135
134
uses : EndBug/add-and-commit@v9
136
135
with :
137
136
default_author : github_actions
0 commit comments