Skip to content

Commit 9d8a93c

Browse files
Update reproducible-build-check.yml
1 parent e2aee83 commit 9d8a93c

File tree

1 file changed

+50
-24
lines changed

1 file changed

+50
-24
lines changed

.github/workflows/reproducible-build-check.yml

Lines changed: 50 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@ on:
55
branches: [ "staging" ]
66

77
jobs:
8-
reproducible-build:
9-
name: Verify Reproducible Build
8+
build-1:
9+
name: Build 1
1010
runs-on: ubuntu-latest
11-
1211
steps:
1312
- name: Checkout repository
1413
uses: actions/checkout@v4
@@ -17,7 +16,7 @@ jobs:
1716
working-directory: ci
1817
run: docker build -t deku_rep_build_release .
1918

20-
- name: First build
19+
- name: Build APK
2120
run: |
2221
docker run --rm \
2322
-v "$(pwd)":/project \
@@ -28,21 +27,31 @@ jobs:
2827
deku_rep_build_release \
2928
./gradlew assembleRelease \
3029
--no-daemon \
31-
--max-workers=1 \
32-
-Dorg.gradle.jvmargs="-Xmx4g -XX:MaxMetaspaceSize=512m" \
30+
--max-workers=2 \
31+
--console=plain \
32+
-Dorg.gradle.jvmargs="-Xmx2048m -Xms512m -XX:MaxMetaspaceSize=512m -Dfile.encoding=UTF-8" \
33+
-Dkotlin.daemon.jvm.options="-Xmx512m,-Xss1m" \
3334
-Dkotlin.compiler.execution.strategy=in-process
3435
35-
- name: Hash first APK
36-
id: sha1
37-
run: |
38-
hash=$(sha256sum app/build/outputs/apk/release/app-release-unsigned.apk)
39-
echo "value=$hash" >> "$GITHUB_OUTPUT"
40-
echo "First build: $hash"
36+
- name: Upload APK
37+
uses: actions/upload-artifact@v4
38+
with:
39+
name: apk-build-1
40+
path: app/build/outputs/apk/release/app-release-unsigned.apk
41+
retention-days: 1
42+
43+
build-2:
44+
name: Build 2
45+
runs-on: ubuntu-latest
46+
steps:
47+
- name: Checkout repository
48+
uses: actions/checkout@v4
4149

42-
- name: Remove first APK
43-
run: rm app/build/outputs/apk/release/app-release-unsigned.apk
50+
- name: Build Docker image
51+
working-directory: ci
52+
run: docker build -t deku_rep_build_release .
4453

45-
- name: Second build
54+
- name: Build APK
4655
run: |
4756
docker run --rm \
4857
-v "$(pwd)":/project \
@@ -55,21 +64,38 @@ jobs:
5564
--no-daemon \
5665
--max-workers=2 \
5766
--console=plain \
58-
-Dorg.gradle.jvmargs="-Xmx1024m -Xms256m -XX:MaxMetaspaceSize=384m -Dfile.encoding=UTF-8" \
67+
-Dorg.gradle.jvmargs="-Xmx2048m -Xms512m -XX:MaxMetaspaceSize=512m -Dfile.encoding=UTF-8" \
5968
-Dkotlin.daemon.jvm.options="-Xmx512m,-Xss1m" \
6069
-Dkotlin.compiler.execution.strategy=in-process
6170
62-
- name: Hash second APK
63-
id: sha2
64-
run: |
65-
hash=$(sha256sum app/build/outputs/apk/release/app-release-unsigned.apk)
66-
echo "value=$hash" >> "$GITHUB_OUTPUT"
67-
echo "Second build: $hash"
71+
- name: Upload APK
72+
uses: actions/upload-artifact@v4
73+
with:
74+
name: apk-build-2
75+
path: app/build/outputs/apk/release/app-release-unsigned.apk
76+
retention-days: 1
77+
78+
compare:
79+
name: Compare APKs
80+
runs-on: ubuntu-latest
81+
needs: [ build-1, build-2 ]
82+
steps:
83+
- name: Download APK from build 1
84+
uses: actions/download-artifact@v4
85+
with:
86+
name: apk-build-1
87+
path: apk-build-1
88+
89+
- name: Download APK from build 2
90+
uses: actions/download-artifact@v4
91+
with:
92+
name: apk-build-2
93+
path: apk-build-2
6894

6995
- name: Compare hashes
7096
run: |
71-
SHA1="${{ steps.sha1.outputs.value }}"
72-
SHA2="${{ steps.sha2.outputs.value }}"
97+
SHA1=$(sha256sum apk-build-1/app-release-unsigned.apk | awk '{ print $1 }')
98+
SHA2=$(sha256sum apk-build-2/app-release-unsigned.apk | awk '{ print $1 }')
7399
echo "Build 1: $SHA1"
74100
echo "Build 2: $SHA2"
75101
if [ "$SHA1" = "$SHA2" ]; then

0 commit comments

Comments
 (0)