Skip to content

Commit de4012c

Browse files
committed
[Build] CI job to update natives
1 parent 3d212c7 commit de4012c

File tree

1 file changed

+27
-13
lines changed

1 file changed

+27
-13
lines changed

.github/workflows/ci-build.yml

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
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'
311
jobs:
412
build-java:
513
strategy:
@@ -8,7 +16,7 @@ jobs:
816
name: Build Java
917
runs-on: ${{ matrix.os }}
1018
steps:
11-
- name: Checkout repository
19+
- name: Checkout Repository
1220
uses: actions/checkout@v2
1321

1422
- name: Set up Java 8
@@ -31,16 +39,10 @@ jobs:
3139
include:
3240
- type: win
3341
expected: /tmp/imgui/libsNative/windows64/imgui-java64.dll
34-
libName: imgui-java64.dll
35-
libNameFt: imgui-java64-ft.dll
3642
- type: linux
3743
expected: /tmp/imgui/libsNative/linux64/libimgui-java64.so
38-
libName: libimgui-java64.so
39-
libNameFt: libimgui-java64-ft.so
4044
- type: mac
4145
expected: /tmp/imgui/libsNative/macosx64/libimgui-java64.dylib
42-
libName: libimgui-java64.dylib
43-
libNameFt: libimgui-java64-ft.dylib
4446
exclude:
4547
- os: ubuntu-20.04
4648
type: mac
@@ -51,7 +53,7 @@ jobs:
5153
name: Build Native (type=${{ matrix.type }}, freetype=${{ matrix.freetype }})
5254
runs-on: ${{ matrix.os }}
5355
steps:
54-
- name: Checkout repository and submodules
56+
- name: Checkout Repository and Submodules
5557
uses: actions/checkout@v2
5658
with:
5759
submodules: recursive
@@ -95,10 +97,11 @@ jobs:
9597
- name: Upload Native
9698
uses: actions/upload-artifact@v2
9799
with:
98-
name: ${{ matrix.freetype && matrix.libNameFt || matrix.libName }}
100+
name: ${{ matrix.freetype && 'freetype' || 'common' }}
99101
path: ${{ matrix.expected }}
100102
if-no-files-found: error
101103
update-natives:
104+
if: github.event.inputs.type == 'update'
102105
name: Update Natives
103106
runs-on: ubuntu-20.04
104107
needs: build-natives
@@ -108,6 +111,17 @@ jobs:
108111
with:
109112
path: /tmp/artifacts
110113

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

Comments
 (0)