Skip to content

Commit fb3cd4a

Browse files
committed
only rebuild on submodule-commit change
1 parent c553611 commit fb3cd4a

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

.github/workflows/build-only.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,19 @@ jobs:
2727
run: |
2828
echo "RELEASE=${{ startsWith(github.ref_name, 'v') }}" >> $GITHUB_ENV
2929
30+
- name: Get aw-server-rust submodule commit
31+
id: submodule-commit
32+
run: |
33+
echo "commit=$(git rev-parse HEAD:aw-server-rust)" >> $GITHUB_OUTPUT
34+
3035
- name: Cache JNI libs
3136
uses: actions/cache@v3
3237
id: cache-jniLibs
3338
env:
3439
cache-name: jniLibs
3540
with:
3641
path: mobile/src/main/jniLibs/
37-
key: ${{ env.cache-name }}-release-${{ env.RELEASE }}-ndk-${{ env.NDK_VERSION }}-${{ hashFiles('.git/modules/aw-server-rust/HEAD') }}
42+
key: ${{ env.cache-name }}-release-${{ env.RELEASE }}-ndk-${{ env.NDK_VERSION }}-${{ steps.submodule-commit.outputs.commit }}
3843

3944
- name: Display structure of downloaded files
4045
if: steps.cache-jniLibs.outputs.cache-hit == 'true'
@@ -148,6 +153,11 @@ jobs:
148153
ls $ANDROID_NDK_HOME
149154
echo "ANDROID_NDK_HOME=$ANDROID_NDK_HOME" >> $GITHUB_ENV
150155
156+
- name: Get aw-server-rust submodule commit
157+
id: submodule-commit
158+
run: |
159+
echo "commit=$(git rev-parse HEAD:aw-server-rust)" >> $GITHUB_OUTPUT
160+
151161
# Restores jniLibs from cache
152162
# `actions/cache/restore` only restores, without saving back in a post-hook
153163
- uses: actions/cache/restore@v3
@@ -156,7 +166,7 @@ jobs:
156166
cache-name: jniLibs
157167
with:
158168
path: mobile/src/main/jniLibs/
159-
key: ${{ env.cache-name }}-release-${{ env.RELEASE }}-ndk-${{ env.NDK_VERSION }}-${{ hashFiles('.git/modules/aw-server-rust/HEAD') }}
169+
key: ${{ env.cache-name }}-release-${{ env.RELEASE }}-ndk-${{ env.NDK_VERSION }}-${{ steps.submodule-commit.outputs.commit }}
160170
fail-on-cache-miss: true
161171

162172
- name: Check that jniLibs present

0 commit comments

Comments
 (0)