[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
|
- name: Ant Version
|
||||||
run: 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
|
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
|
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: |
|
run: |
|
||||||
sudo mkdir /freetype
|
sudo mkdir /freetype
|
||||||
sudo tar -xzf ./vendor/freetype-2.12.1.tar.gz -C /freetype --strip-components=1
|
sudo tar -xzf ./vendor/freetype-2.12.1.tar.gz -C /freetype --strip-components=1
|
||||||
@@ -98,8 +98,8 @@ jobs:
|
|||||||
path: ${{ matrix.expected }}
|
path: ${{ matrix.expected }}
|
||||||
|
|
||||||
update-bin:
|
update-bin:
|
||||||
if: github.ref == 'refs/heads/main' # runs only on the main branch
|
|
||||||
name: Update Binaries
|
name: Update Binaries
|
||||||
|
if: github.ref == 'refs/heads/main' # runs only on the main branch
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: build-natives
|
needs: build-natives
|
||||||
steps:
|
steps:
|
||||||
@@ -111,20 +111,33 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
path: /tmp/artifacts
|
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
|
- name: Update
|
||||||
|
if: steps.equal-artifacts.outcome != 'success'
|
||||||
run: |
|
run: |
|
||||||
mv /tmp/artifacts/native-libraries/* bin/
|
mv /tmp/artifacts/native-libraries/* bin/
|
||||||
mv /tmp/artifacts/native-libraries-with-freetype/* bin/freetype/
|
mv /tmp/artifacts/native-libraries-with-freetype/* bin/freetype/
|
||||||
|
|
||||||
- name: Commit
|
- name: Commit
|
||||||
|
if: steps.equal-artifacts.outcome != 'success'
|
||||||
uses: EndBug/add-and-commit@v9
|
uses: EndBug/add-and-commit@v9
|
||||||
with:
|
with:
|
||||||
default_author: github_actions
|
default_author: github_actions
|
||||||
message: '[ci skip] update native binaries'
|
message: '[ci skip] update native binaries'
|
||||||
|
|
||||||
release:
|
release:
|
||||||
if: startsWith(github.ref, 'refs/tags/v') # if tag starts with "v"
|
|
||||||
name: Release
|
name: Release
|
||||||
|
if: startsWith(github.ref, 'refs/tags/v') # if tag starts with "v"
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [ build-java, build-natives ]
|
needs: [ build-java, build-natives ]
|
||||||
steps:
|
steps:
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
import sys
|
||||||
|
import os
|
||||||
|
|
||||||
|
# A python script to compare file size of two files.
|
||||||
|
# Used to compare sizes of binaries to see, if there is a difference between them.
|
||||||
|
# Shell scripts are not used, since Python is a more portable solution.
|
||||||
|
|
||||||
|
os.path.getsize(sys.argv[1]) == os.path.getsize(sys.argv[2]) if sys.exit(0) else sys.exit(1)
|
||||||
Reference in new issue
Block a user