-
Notifications
You must be signed in to change notification settings - Fork 18
90 lines (79 loc) · 2.96 KB
/
android.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
name: Android CI
on:
push:
branches: [ "alpha" ]
paths-ignore:
- ".github/**"
- "!.github/workflows/**"
- ".idea/"
- "fastlane/"
- '.gitignore'
- "*.md"
- "LICENSE"
pull_request:
branches: [ "alpha" ]
paths-ignore:
- ".github/**"
- "!.github/workflows/**"
- ".idea/"
- "fastlane/"
- '.gitignore'
- "*.md"
- "LICENSE"
workflow_dispatch:
jobs:
build:
name: Build App
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Set release type
run: echo releaseType=CI > package.properties
- name: Create signing files
if: github.event_name == 'push' && !contains(github.event.head_commit.message, '[skip_signing_apk]')
run: |
mkdir -p ~/.gradle
echo "${{ secrets.KEYSTORE_SECRET }}" | base64 -d > ~/key.jks
echo "AKANE_RELEASE_STORE_FILE=$(realpath ~/key.jks)" > ~/.gradle/gradle.properties
echo "AKANE_RELEASE_STORE_PASSWORD=${{ secrets.KEYSTORE_PWD }}" >> ~/.gradle/gradle.properties
echo "AKANE_RELEASE_KEY_ALIAS=${{ secrets.KEY_ALIAS }}" >> ~/.gradle/gradle.properties
echo "AKANE_RELEASE_KEY_PASSWORD=${{ secrets.KEY_PWD }}" >> ~/.gradle/gradle.properties
- name: Build with Gradle
run: ./gradlew :app:assembleRelease
- name: Find apk
run: |
echo "APK_FILE_X64=$(find app/build/outputs/apk/release -name '*-x86_64-*.apk')" >> $GITHUB_ENV
echo "APK_FILE_ARM64=$(find app/build/outputs/apk/release -name '*-arm64-v8a-*.apk')" >> $GITHUB_ENV
echo "APK_FILE_UNIVERSAL=$(find app/build/outputs/apk/release -name '*-universal-*.apk')" >> $GITHUB_ENV
GIT_COMMIT_HASH=$(git rev-parse --short HEAD)
ACCORD_VERSION=$(grep "versionName" app/build.gradle.kts | awk -F'"' '{print $2}' | head -n 1)
APK_FILE_NAME=Accord-$ACCORD_VERSION-$GIT_COMMIT_HASH
echo "APK_FILE_NAME_X64=$APK_FILE_NAME-x86_64" >> $GITHUB_ENV
echo "APK_FILE_NAME_ARM64=$APK_FILE_NAME-arm64-v8a" >> $GITHUB_ENV
echo "APK_FILE_NAME_UNIVERSAL=$APK_FILE_NAME-universal" >> $GITHUB_ENV
- name: Upload x86_64 apk
uses: actions/upload-artifact@v4
with:
name: ${{ env.APK_FILE_NAME_X64 }}
path: ${{ env.APK_FILE_X64 }}
compression-level: 9
- name: Upload arm64-v8a apk
uses: actions/upload-artifact@v4
with:
name: ${{ env.APK_FILE_NAME_ARM64 }}
path: ${{ env.APK_FILE_ARM64 }}
compression-level: 9
- name: Upload universal apk
uses: actions/upload-artifact@v4
with:
name: ${{ env.APK_FILE_NAME_UNIVERSAL }}
path: ${{ env.APK_FILE_UNIVERSAL }}
compression-level: 9