Skip to content

Commit 7f01f99

Browse files
ci: add binary-bump consistency check
1 parent aa034ac commit 7f01f99

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Binary bump consistency
2+
3+
# Guards the native-binaries pin: if the release tag changes, the integrity
4+
# manifest must change in the same PR (see controller/docs/UPDATING_NATIVE_BINARIES.md).
5+
# Complements PR #150, which bumped binary_version.txt without ninja_manifest.json.
6+
7+
on:
8+
pull_request:
9+
branches: [ "main", "development" ]
10+
paths:
11+
- 'controller/binary_version.txt'
12+
- 'controller/app/src/main/assets/ninja_manifest.json'
13+
14+
jobs:
15+
check:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
- name: Ensure binary_version.txt and ninja_manifest.json move together
22+
run: |
23+
base="origin/${{ github.base_ref }}"
24+
changed=$(git diff --name-only "$base"...HEAD)
25+
ver='controller/binary_version.txt'
26+
man='controller/app/src/main/assets/ninja_manifest.json'
27+
echo "$changed" | grep -qx "$ver" && v=1 || v=0
28+
echo "$changed" | grep -qx "$man" && m=1 || m=0
29+
if [ "$v" != "$m" ]; then
30+
echo "::error::binary_version.txt and ninja_manifest.json must change together (incomplete binary bump). See controller/docs/UPDATING_NATIVE_BINARIES.md"
31+
exit 1
32+
fi
33+
echo "OK: version pin and integrity manifest are consistent."

0 commit comments

Comments
 (0)