-
Notifications
You must be signed in to change notification settings - Fork 8
82 lines (77 loc) · 3.04 KB
/
Copy pathandroid_release.yml
File metadata and controls
82 lines (77 loc) · 3.04 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
name: Android Release
on:
push:
tags:
- 'v*'
workflow_dispatch:
permissions:
contents: write
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false
env:
CARGO_HOME: ${{ github.workspace }}/.cache/cargo-home
HOME: ${{ github.workspace }}/.home
ANDROID_USER_HOME: ${{ github.workspace }}/.android
XDG_DATA_HOME: ${{ github.workspace }}/.local/share
XDG_CONFIG_HOME: ${{ github.workspace }}/.config
LOMO_KOTLIN_GRADLE_USER_HOME: ${{ github.workspace }}/.gradle/kotlin-toolchain
KOTLIN_CLI_BOOTSTRAP_CACHE_DIR: ${{ github.workspace }}/.kotlin-cli
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Set up JDK 26
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
with:
distribution: zulu
java-version: '26'
- name: Set up Android SDK
uses: android-actions/setup-android@9fc6c4e9069bf8d3d10b2204b1fb8f6ef7065407 # v3.2.2
- name: Cache release toolchain
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
with:
path: |
.cache
.gradle/kotlin-toolchain
.kotlin-cli
rust/target
${{ env.ANDROID_HOME }}/ndk/29.0.14206865
key: release-1.97-ndk29-${{ hashFiles('rust/Cargo.lock', 'rust/tools.toml', 'kotlin', 'project.yaml', '**/module.yaml') }}
- name: Decode release keystore
env:
KEYSTORE_BASE64: ${{ secrets.KEYSTORE_BASE64 }}
run: |
test -n "$KEYSTORE_BASE64"
printf '%s' "$KEYSTORE_BASE64" | base64 --decode > release.keystore
test -s release.keystore
- name: Bootstrap pinned toolchain
run: cargo run --manifest-path rust/Cargo.toml --locked -p lomo-xtask -- bootstrap
- name: Run full gate
run: cargo run --manifest-path rust/Cargo.toml --locked -p lomo-xtask -- ci
- name: Build, validate, and sign release APKs
env:
KEYSTORE_FILE: release.keystore
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
run: |
for abi in arm64-v8a armeabi-v7a x86_64 x86 all; do
echo "Building release APK for $abi..."
cargo run --manifest-path rust/Cargo.toml --locked -p lomo-xtask -- android release "$abi"
done
- name: Upload release APKs
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: release-apks
path: .kotlin/artifacts/android-release/lomo-release-*.apk
if-no-files-found: error
- name: Publish GitHub release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@72f2c25fcb47643c292f7107632f7a47c1df5cd8 # v2.3.2
with:
files: .kotlin/artifacts/android-release/lomo-release-*.apk