-
Notifications
You must be signed in to change notification settings - Fork 169
120 lines (105 loc) · 3.9 KB
/
Copy pathasm_build.yml
File metadata and controls
120 lines (105 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
name: Build Android Code Studio
on:
push:
branches:
- "dev"
- "main"
- "indexing"
- "release/**"
paths-ignore:
- '**.md'
- '**.json'
- 'fastlane/**'
- '.github/workflows/crowdin_contributors.yml'
pull_request:
branches: [ "dev" ]
paths-ignore:
- '**.md'
- '**.json'
- 'fastlane/**'
- '.github/workflows/crowdin_contributors.yml'
workflow_dispatch:
inputs:
build_type:
description: 'Select Build Type'
required: true
default: 'Debug'
type: choice
options:
- Debug
- Release
jobs:
build_release_apk:
name: Build APK
runs-on: ubuntu-latest
steps:
- name: Cancel previous runs
uses: styfle/cancel-workflow-action@0.12.1
with:
access_token: ${{ github.token }}
- name: Checkout
uses: actions/checkout@v4
with:
submodules: 'recursive'
fetch-depth: 0
- name: Determine Build Type Configuration
run: |
SELECTED_TYPE="${{ github.event.inputs.build_type }}"
BUILD_TYPE="${SELECTED_TYPE:-Debug}"
echo "BUILD_TYPE=$BUILD_TYPE" >> $GITHUB_ENV
echo "BUILD_TYPE_LOWER=$(echo "$BUILD_TYPE" | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'adopt'
- name: Generating missing dirs
run: mkdir -p /home/runner/work/android-code-studio/android-code-studio/core/app/build/intermediates/external_file_lib_dex_archives/debug/desugarDebugFileDependencies && mkdir -p /home/runner/work/android-code-studio/android-code-studio/core/app/build/intermediates/l8_art_profile/release/l8DexDesugarLibRelease
- name: Change Gradle wrapper permissions
run: chmod +x ./gradlew
- name: Restore cache
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-v2-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Create local.properties
run: |
echo "signing.storeFile=signing/signing-key.jks" >> local.properties
echo "signing.storePassword=${{ secrets.SIGNING_SK_PASSWORD }}" >> local.properties
echo "signing.keyAlias=androidcs" >> local.properties
echo "signing.keyPassword=${{ secrets.SIGNING_SK_PASSWORD }}" >> local.properties
- name: Assemble APK
env:
SIGNING_STORE_PASSWORD: ${{ secrets.SIGNING_STORE_PASSWORD }}
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }}
run: ./gradlew assemble${{ env.BUILD_TYPE }}
- name: List APK files
run: ls -la core/app/build/outputs/apk/${{ env.BUILD_TYPE_LOWER }}/ || echo "Directory not found"
- name: Upload arm64-v8a APK
uses: actions/upload-artifact@v4
with:
name: apk-arm64-v8a-${{ env.BUILD_TYPE_LOWER }}
path: core/app/build/outputs/apk/${{ env.BUILD_TYPE_LOWER }}/*arm64-v8a*.apk
if: always()
- name: Upload armeabi-v7a APK
uses: actions/upload-artifact@v4
with:
name: apk-armeabi-v7a-${{ env.BUILD_TYPE_LOWER }}
path: core/app/build/outputs/apk/${{ env.BUILD_TYPE_LOWER }}/*armeabi-v7a*.apk
if: always()
- name: Upload x86_64 APK
uses: actions/upload-artifact@v4
with:
name: apk-x86_64-${{ env.BUILD_TYPE_LOWER }}
path: core/app/build/outputs/apk/${{ env.BUILD_TYPE_LOWER }}/*x86_64*.apk
if: always()
- name: Upload universal APK
uses: actions/upload-artifact@v4
with:
name: apk-universal-${{ env.BUILD_TYPE_LOWER }}
path: core/app/build/outputs/apk/${{ env.BUILD_TYPE_LOWER }}/*universal*.apk
if: always()