[Build] Update artifacts only when needed (#150)
This commit is contained in:
1 parent
8356d76a62
commit
a2bacb292e
2 files changed
+29
-8
No files matched your search
@@ -69,16 +69,16 @@ jobs:
|
||||
- name: Ant Version
|
||||
run: ant -version
|
||||
|
||||
- if: matrix.os == 'ubuntu-latest'
|
||||
name: Install MinGW-w64/GCC/G++ (Linux & Windows)
|
||||
- name: Install MinGW-w64/GCC/G++ (Linux & Windows)
|
||||
if: matrix.os == 'ubuntu-latest'
|
||||
run: sudo apt install mingw-w64
|
||||
|
||||
- if: matrix.os == 'ubuntu-latest' && matrix.type == 'linux' && matrix.freetype == true
|
||||
name: FreeType - Install (Linux)
|
||||
- name: FreeType - Install (Linux)
|
||||
if: matrix.os == 'ubuntu-latest' && matrix.type == 'linux' && matrix.freetype == true
|
||||
run: sudo apt install libfreetype6-dev
|
||||
|
||||
- if: matrix.os == 'ubuntu-latest' && matrix.type == 'windows' && matrix.freetype == true
|
||||
name: FreeType - Install (Windows)
|
||||
- name: FreeType - Install (Windows)
|
||||
if: matrix.os == 'ubuntu-latest' && matrix.type == 'windows' && matrix.freetype == true
|
||||
run: |
|
||||
sudo mkdir /freetype
|
||||
sudo tar -xzf ./vendor/freetype-2.12.1.tar.gz -C /freetype --strip-components=1
|
||||
@@ -98,8 +98,8 @@ jobs:
|
||||
path: ${{ matrix.expected }}
|
||||
|
||||
update-bin:
|
||||
if: github.ref == 'refs/heads/main' # runs only on the main branch
|
||||
name: Update Binaries
|
||||
if: github.ref == 'refs/heads/main' # runs only on the main branch
|
||||
runs-on: ubuntu-latest
|
||||
needs: build-natives
|
||||
steps:
|
||||
@@ -111,20 +111,33 @@ jobs:
|
||||
with:
|
||||
path: /tmp/artifacts
|
||||
|
||||
- name: Equal Artifacts
|
||||
id: equal-artifacts
|
||||
continue-on-error: true
|
||||
run: |
|
||||
python3 buildSrc/scripts/equal_file_size.py /tmp/artifacts/native-libraries/imgui-java64.dll bin/imgui-java64.dll
|
||||
python3 buildSrc/scripts/equal_file_size.py /tmp/artifacts/native-libraries/libimgui-java64.dylib bin/libimgui-java64.dylib
|
||||
python3 buildSrc/scripts/equal_file_size.py /tmp/artifacts/native-libraries/libimgui-java64.so bin/libimgui-java64.so
|
||||
python3 buildSrc/scripts/equal_file_size.py /tmp/artifacts/native-libraries-with-freetype/imgui-java64.dll bin/freetype/imgui-java64.dll
|
||||
python3 buildSrc/scripts/equal_file_size.py /tmp/artifacts/native-libraries-with-freetype/libimgui-java64.dylib bin/freetype/libimgui-java64.dylib
|
||||
python3 buildSrc/scripts/equal_file_size.py /tmp/artifacts/native-libraries-with-freetype/libimgui-java64.so bin/freetype/libimgui-java64.so
|
||||
|
||||
- name: Update
|
||||
if: steps.equal-artifacts.outcome != 'success'
|
||||
run: |
|
||||
mv /tmp/artifacts/native-libraries/* bin/
|
||||
mv /tmp/artifacts/native-libraries-with-freetype/* bin/freetype/
|
||||
|
||||
- name: Commit
|
||||
if: steps.equal-artifacts.outcome != 'success'
|
||||
uses: EndBug/add-and-commit@v9
|
||||
with:
|
||||
default_author: github_actions
|
||||
message: '[ci skip] update native binaries'
|
||||
|
||||
release:
|
||||
if: startsWith(github.ref, 'refs/tags/v') # if tag starts with "v"
|
||||
name: Release
|
||||
if: startsWith(github.ref, 'refs/tags/v') # if tag starts with "v"
|
||||
runs-on: ubuntu-latest
|
||||
needs: [ build-java, build-natives ]
|
||||
steps:
|
||||
|
||||
Reference in new issue
Block a user