-
Notifications
You must be signed in to change notification settings - Fork 351
114 lines (99 loc) · 3.12 KB
/
android-app-reproducible.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
---
name: Android - Reprodubile
on:
workflow_dispatch:
inputs:
override_container_image:
description: Override container image
type: string
required: false
push:
branches: [wip-reproducible-action]
jobs:
prepare:
name: Prepare
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Use custom container image if specified
if: ${{ github.event.inputs.override_container_image != '' }}
run: echo "inner_container_image=${{ github.event.inputs.override_container_image }}"
>> $GITHUB_ENV
- name: Use default container image and resolve digest
if: ${{ github.event.inputs.override_container_image == '' }}
run: |
echo "inner_container_image=$(cat ./building/android-container-image.txt)" >> $GITHUB_ENV
outputs:
container_image: ${{ env.inner_container_image }}
build:
name: Reproducible build
needs: [prepare]
runs-on: ubuntu-latest
timeout-minutes: 60
container:
image: ${{ needs.prepare.outputs.container_image }}
strategy:
fail-fast: true
matrix:
include:
- iteration: a
type: nativeful
command: ./build-apk.sh --fdroid
path: dist
- iteration: b
type: nativeful
command: ./build-apk.sh --fdroid
path: dist
- iteration: a
type: nativeless
command: ./android/gradlew -p android clean assembleOssProdFdroid
path: android/app/build/outputs/apk/ossProd/fdroid
- iteration: b
type: nativeless
command: ./android/gradlew -p android clean assembleOssProdFdroid
path: android/app/build/outputs/apk/ossProd/fdroid
steps:
- name: Fix HOME path
run: echo "HOME=/root" >> $GITHUB_ENV
- name: Fix git dir
run: git config --global --add safe.directory $(pwd)
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true
- name: Build (${{ matrix.type }}-${{ matrix.iteration }})
run: bash -c "${{ matrix.command }}"
- name: Upload (${{ matrix.type }}-${{ matrix.iteration }})
uses: actions/upload-artifact@v4
with:
name: apk-${{ matrix.type }}-${{ matrix.iteration }}
path: ${{ matrix.path }}
if-no-files-found: error
retention-days: 7
verify-builds:
name: Verify builds
needs: [build]
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
include:
- type: nativeful
path: dist
- type: nativeless
path: dist
steps:
- name: Install diffoscope
run: apt-get install diffoscope
- uses: actions/download-artifact@v4
with:
pattern: apk-${{ matrix.type }}-*
path: apks
merge-multiple: true
- name: Fix git dir
run: find apks
- name: print checksums
run: find apks -name "*.apk" | xargs sha256sum
- name: Run diffoscope
run: diffoscope apks/*