This repository has been archived by the owner on Jan 10, 2025. It is now read-only.
forked from mollyim/mollyim-android
-
Notifications
You must be signed in to change notification settings - Fork 5
127 lines (106 loc) · 3.48 KB
/
reprocheck.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
name: Reproducible build
on:
workflow_dispatch:
inputs:
tag_name:
description: "Enter the version to check"
required: true
prerelease:
description: 'Pre-release build'
required: true
type: boolean
release:
types:
- published
permissions:
contents: read # to fetch code (actions/checkout)
env:
TAG_NAME: "${{ github.event.inputs.tag_name || github.event.release.tag_name }}"
PRE_RELEASE: "${{ github.event.inputs.prerelease || github.event.release.prerelease }}"
jobs:
build:
name: Build new
runs-on: ubuntu-22.04
env:
GRADLE_OPTS: "-Dorg.gradle.project.kotlin.compiler.execution.strategy=in-process"
CI_MAPS_API_KEY: ${{ secrets.MAPS_API_KEY }}
steps:
- uses: actions/checkout@v3
with:
ref: "${{ env.TAG_NAME }}"
- name: Set up builder image
run: docker-compose build
working-directory: reproducible-builds
- name: Build release
if: "env.PRE_RELEASE == 'false'"
run: docker-compose --env-file ci/release.env run assemble
working-directory: reproducible-builds
- name: Build pre-release
if: "env.PRE_RELEASE == 'true'"
run: docker-compose --env-file ci/prerelease.env run assemble
working-directory: reproducible-builds
- uses: actions/upload-artifact@v3
with:
name: new
path: reproducible-builds/outputs/apk/*/release/*.apk
if-no-files-found: error
- uses: actions/upload-artifact@v3
with:
name: apkdiff
path: reproducible-builds/apkdiff/apkdiff.py
if-no-files-found: error
download:
name: Download original
runs-on: ubuntu-22.04
outputs:
apks: "${{ steps.set.outputs.apks }}"
steps:
- uses: actions/checkout@v3
with:
ref: "${{ env.TAG_NAME }}"
- name: Download published APKs
run: gh release download --pattern '*.apk' "$TAG_NAME"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/upload-artifact@v3
with:
name: original
path: "*.apk"
if-no-files-found: error
- name: Output filenames to compare
id: set
run: |
apks=$(jq -c -n '[$ARGS.positional[] | sub("-unsigned-";"-")]' --args *.apk)
echo "apks=$apks" >> $GITHUB_OUTPUT
compare:
name: Compare
runs-on: ubuntu-22.04
needs:
- build
- download
strategy:
fail-fast: false
matrix:
apk-file: ${{ fromJSON(needs.download.outputs.apks) }}
steps:
- uses: actions/download-artifact@v3
- name: Install diffuse
run: |
curl -o diffuse.jar -L https://github.com/JakeWharton/diffuse/releases/download/0.1.0/diffuse-0.1.0-binary.jar
echo "$SHA256" diffuse.jar | sha256sum -c -
env:
SHA256: 60d619373c46a5d06b8126c1d61e0adc18b72f2cbb9245ef920d3387e44b86cf
- name: Normalize APK filenames
run: |
mv -v new/*/release/*.apk new/
for fn in */*-unsigned-*.apk; do
mv -v "$fn" "$(sed 's/-unsigned-/-/' <<< $fn)"
done
- name: Log diffuse full output
run: java -jar diffuse.jar diff "original/$APK_FILE" "new/$APK_FILE"
env:
APK_FILE: "${{ matrix.apk-file }}"
- name: Check for reproducibility
run: python apkdiff/apkdiff.py "original/$APK_FILE" "new/$APK_FILE"
env:
APK_FILE: "${{ matrix.apk-file }}"