1
1
name : CI Build
2
- on : [ push, pull_request ]
2
+ on :
3
+ push :
4
+ pull_request :
5
+ workflow_dispatch :
6
+ inputs :
7
+ type :
8
+ description : ' Type'
9
+ required : true
10
+ default : ' update'
3
11
jobs :
4
12
build-java :
5
13
strategy :
8
16
name : Build Java
9
17
runs-on : ${{ matrix.os }}
10
18
steps :
11
- - name : Checkout repository
19
+ - name : Checkout Repository
12
20
uses : actions/checkout@v2
13
21
14
22
- name : Set up Java 8
@@ -31,16 +39,10 @@ jobs:
31
39
include :
32
40
- type : win
33
41
expected : /tmp/imgui/libsNative/windows64/imgui-java64.dll
34
- libName : imgui-java64.dll
35
- libNameFt : imgui-java64-ft.dll
36
42
- type : linux
37
43
expected : /tmp/imgui/libsNative/linux64/libimgui-java64.so
38
- libName : libimgui-java64.so
39
- libNameFt : libimgui-java64-ft.so
40
44
- type : mac
41
45
expected : /tmp/imgui/libsNative/macosx64/libimgui-java64.dylib
42
- libName : libimgui-java64.dylib
43
- libNameFt : libimgui-java64-ft.dylib
44
46
exclude :
45
47
- os : ubuntu-20.04
46
48
type : mac
51
53
name : Build Native (type=${{ matrix.type }}, freetype=${{ matrix.freetype }})
52
54
runs-on : ${{ matrix.os }}
53
55
steps :
54
- - name : Checkout repository and submodules
56
+ - name : Checkout Repository and Submodules
55
57
uses : actions/checkout@v2
56
58
with :
57
59
submodules : recursive
@@ -95,10 +97,11 @@ jobs:
95
97
- name : Upload Native
96
98
uses : actions/upload-artifact@v2
97
99
with :
98
- name : ${{ matrix.freetype && matrix.libNameFt || matrix.libName }}
100
+ name : ${{ matrix.freetype && 'freetype' || 'common' }}
99
101
path : ${{ matrix.expected }}
100
102
if-no-files-found : error
101
103
update-natives :
104
+ if : github.event.inputs.type == 'update'
102
105
name : Update Natives
103
106
runs-on : ubuntu-20.04
104
107
needs : build-natives
@@ -108,6 +111,17 @@ jobs:
108
111
with :
109
112
path : /tmp/artifacts
110
113
111
- - name : Display Natives
112
- run : ls -al
113
- working-directory : /tmp/artifacts
114
+ - name : Checkout Repository
115
+ uses : actions/checkout@v2
116
+ with :
117
+ token : ${{ secrets.GH_ACTIONS_REPO }}
118
+
119
+ - name : Move Natives
120
+ run : |
121
+ mv /tmp/artifacts/common/* bin/
122
+ mv /tmp/artifacts/freetype/* bin/freetype/
123
+
124
+ - uses : EndBug/add-and-commit@v7
125
+ with :
126
+ message : ' [skip ci] Update native binaries'
127
+ default_author : github_actions
0 commit comments