forked from signalapp/Signal-Android
-
-
Notifications
You must be signed in to change notification settings - Fork 0
105 lines (90 loc) · 3.9 KB
/
Copy pathandroid.yml
File metadata and controls
105 lines (90 loc) · 3.9 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
name: Android CI
on:
pull_request:
push:
branches:
- 'main'
permissions:
contents: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
# gh api repos/actions/checkout/commits/v6 --jq '.sha'
with:
submodules: true
lfs: true
- name: Retrieve commit identification
if: ${{ github.event_name == 'push' }}
run: |
echo "GIT_BRANCH=${GITHUB_REF_NAME}" >> "$GITHUB_ENV"
echo "GIT_HASH=$(git rev-parse --short HEAD)" >> "$GITHUB_ENV"
- name: set up JDK 21
uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5
# gh api repos/actions/setup-java/commits/v5 --jq '.sha'
with:
distribution: temurin
java-version: 21
- name: Validate Gradle Wrapper
uses: gradle/actions/wrapper-validation@3f131e8634966bd73d06cc69884922b02e6faf92 # v6
# gh api repos/gradle/actions/commits/v6 --jq '.sha'
- name: Set up Gradle
uses: gradle/actions/setup-gradle@3f131e8634966bd73d06cc69884922b02e6faf92 # v6
# gh api repos/gradle/actions/commits/v6 --jq '.sha'
with:
# Pull requests read the cache; main builds may refresh it.
cache-read-only: ${{ github.event_name == 'pull_request' }}
# Required to persist the Gradle configuration cache across runs.
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
- name: Build with Gradle
env:
SIGNAL_BUILD_CACHE_URL: ${{ secrets.SIGNAL_BUILD_CACHE_URL }}
SIGNAL_BUILD_CACHE_USER: ${{ secrets.SIGNAL_BUILD_CACHE_USER }}
SIGNAL_BUILD_CACHE_PASSWORD: ${{ secrets.SIGNAL_BUILD_CACHE_PASSWORD }}
SIGNAL_BUILD_CACHE_PUSH: ${{ github.event_name == 'push' }}
# ubuntu-latest provides 16 GB RAM; keep Gradle and Kotlin below that ceiling so the
# runner remains responsive while Android tooling and test processes are active.
run: ./gradlew --no-daemon --max-workers=2 -Dorg.gradle.jvmargs="-Xmx8g -Xms256m -XX:MaxMetaspaceSize=768m -Dcom.android.tools.r8.deterministicdebugging=true -XX:+UnlockExperimentalVMOptions -XX:hashCode=3" -Pkotlin.daemon.jvmargs="-Xmx4g -XX:MaxMetaspaceSize=512m" assembleBitProdRelease
- name: Sign app APK
if: ${{ github.event_name == 'push' }}
id: sign_app
uses: r0adkll/sign-android-release@v1
with:
releaseDirectory: app/build/outputs/apk/bitProd/release
signingKeyBase64: ${{ secrets.KEYSTORE }}
alias: ${{ secrets.KEYALIAS }}
keyStorePassword: ${{ secrets.KEYSTORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
env:
BUILD_TOOLS_VERSION: "34.0.0"
- name: Upload release artifact
if: ${{ github.event_name == 'push' }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
# gh api repos/actions/upload-artifact/commits/v7 --jq '.sha'
with:
name: Signal-Android-${{ env.GIT_HASH }}
retention-days: 1
path: ${{ steps.sign_app.outputs.signedReleaseFile }}
- name: Publish GitHub Release
if: ${{ github.event_name == 'push' }}
uses: SamSprung/action-github-releases@v1.0.0
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "8bit/${{ env.GIT_BRANCH }}"
prerelease: ${{ env.GIT_BRANCH != 'main' }}
title: Signal-Android-${{ env.GIT_HASH }}
files: ${{ steps.sign_app.outputs.signedReleaseFile }}
- name: Archive reports for failed build
if: ${{ failure() }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
# gh api repos/actions/upload-artifact/commits/v7 --jq '.sha'
with:
name: reports
path: |
**/build/reports
**/build/test-results
if-no-files-found: ignore