Repository navigation
138 lines (118 loc) · 5.27 KB
/
Copy pathandroid-build.yml
File metadata and controls
138 lines (118 loc) · 5.27 KB
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
128
129
130
131
132
133
134
135
136
137
138
name: Android App CI
permissions:
contents: read
on:
push:
branches: [ master ]
jobs:
changes:
uses: ./.github/workflows/app-change-detection.yml
build-android:
environment: android-signing
needs: changes
if: ${{ always() && !cancelled() && (needs.changes.result != 'success' || needs.changes.outputs.frontend != 'false' || needs.changes.outputs.android != 'false') }}
runs-on: blacksmith-8vcpu-ubuntu-2404
timeout-minutes: 90
permissions:
contents: read
id-token: write
attestations: write
artifact-metadata: write
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # was v4
with:
persist-credentials: false
- name: Install Nix
uses: DeterminateSystems/determinate-nix-action@96c5ee93a9dddf2830d31e1da6ec719077336c28 # v3.23.3
with:
source-tag: v3.23.3
github-token: ""
- name: Verify pinned Nix runtime
run: bash scripts/ci/verify-nix-runtime.sh
- name: Cache Bun dependencies
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # was v4
with:
path: |
~/.bun/install/cache
key: ${{ runner.os }}-bun-${{ hashFiles('apps/maple-research/frontend/bun.lock', 'sdk/bun.lock') }}
- name: Cache Gradle
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # was v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('apps/maple-research/frontend/src-tauri/gen/android/**/*.gradle*', 'apps/maple-research/frontend/src-tauri/gen/android/gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Cache sccache
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # was v4
with:
path: ~/.cache/sccache
key: ${{ runner.os }}-sccache-android-release-${{ hashFiles('apps/maple-research/frontend/src-tauri/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-sccache-android-release-
${{ runner.os }}-sccache-android-
${{ runner.os }}-sccache-
- name: Build Tauri Android App (signed)
run: nix develop --no-update-lock-file .#android -c ./scripts/ci/android-release.sh
env:
ANDROID_KEYSTORE_BASE64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}
ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }}
ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }}
- name: Show sccache stats
if: always()
run: nix develop --no-update-lock-file .#android -c ./scripts/ci/sccache-stats.sh
- name: Collect Android release checksums
run: |
nix develop --no-update-lock-file .#android -c ./scripts/ci/attestation-manifest.sh \
android-release-artifacts.sha256 \
apps/maple-research/frontend/src-tauri/target/reproducibility/android-release-final.sha256 \
apps/maple-research/frontend/src-tauri/target/reproducibility/android-release-*.sha256
cat android-release-artifacts.sha256
- name: Attest Android release artifacts
# Keep uploads/verifiers running if GitHub token policy rejects artifact attestation.
continue-on-error: true
uses: actions/attest@281a49d4cbb0a72c9575a50d18f6deb515a11deb # was v4
with:
subject-checksums: android-release-artifacts.sha256
- name: Upload Android APK
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # was v4
with:
name: maple-android-apk
path: |
apps/maple-research/frontend/src-tauri/gen/android/app/build/outputs/apk/universal/release/app-universal-release.apk
apps/maple-research/frontend/src-tauri/target/reproducibility/*.sha256
retention-days: 5
- name: Upload Android AAB
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # was v4
with:
name: maple-android-aab
path: |
apps/maple-research/frontend/src-tauri/gen/android/app/build/outputs/bundle/universalRelease/app-universal-release.aab
apps/maple-research/frontend/src-tauri/target/reproducibility/*.sha256
retention-days: 5
verify-android-artifacts:
needs: build-android
runs-on: ubuntu-latest
timeout-minutes: 20
permissions:
contents: read
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # was v4
with:
persist-credentials: false
- name: Install Nix
uses: DeterminateSystems/determinate-nix-action@96c5ee93a9dddf2830d31e1da6ec719077336c28 # v3.23.3
with:
source-tag: v3.23.3
github-token: ""
- name: Verify pinned Nix runtime
run: bash scripts/ci/verify-nix-runtime.sh
- name: Download Android artifacts
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # was v4
with:
path: artifacts
- name: Verify Android artifact reproducibility proofs
env:
MAPLE_REQUIRE_ANDROID_SIGNATURE_VERIFICATION: "1"
run: nix develop --no-update-lock-file .#android -c ./scripts/ci/verify-release-artifacts.sh artifacts android