forked from OwnTube-tv/web-client
-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (70 loc) · 2.53 KB
/
build_android_apk.yml
File metadata and controls
83 lines (70 loc) · 2.53 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
name: Build Android .APK
on:
workflow_call:
inputs:
owntube_source:
required: false
type: string
description: "The repository with OwnTube-tv/web-client code. Defaults to the source repository."
use_parent_repo_customizations:
required: false
type: boolean
description: "Should a parent repo be used for customizations? (Required for branded builds)"
customizations_env_content:
required: false
type: string
build_info:
required: true
type: string
jobs:
build_android_apk:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
repository: ${{ inputs.owntube_source || github.repository }}
- name: Checkout parent repo with customizations
uses: actions/checkout@v4
if: ${{ inputs.use_parent_repo_customizations }}
with:
path: customizations
- name: Setup Node 20
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Install Dependencies
run: cd OwnTube.tv/ && npm install
- name: Create .env File
if: ${{ inputs.customizations_env_content != '' }}
run: |
echo "${{ inputs.customizations_env_content }}" > ./OwnTube.tv/.env
- name: Expo Prebuild Android Assets
env:
EXPO_PUBLIC_ANDROID_RELEASE_SIGNING_STORE_FILE_NAME: "debug.keystore"
EXPO_PUBLIC_ANDROID_RELEASE_SIGNING_STORE_FILE_PASSWORD: "android"
EXPO_PUBLIC_ANDROID_RELEASE_SIGNING_KEY_ALIAS: "androiddebugkey"
EXPO_PUBLIC_ANDROID_RELEASE_SIGNING_KEY_PASSWORD: "android"
run: cd OwnTube.tv/ && npx expo prebuild --clean --platform android
- name: Set Up JDK
uses: actions/setup-java@v4
with:
distribution: "zulu"
java-version: "17"
cache: "gradle"
- name: Validate Gradle Wrapper
uses: gradle/actions/wrapper-validation@v4
- name: Change Wrapper Permissions
run: cd OwnTube.tv/android/ && chmod +x ./gradlew
- name: Inject Build Info
run: |
cat > ./OwnTube.tv/build-info.json << 'EOF'
${{ inputs.build_info }}
EOF
- name: Build Release APK by @${{ github.actor }}
run: cd OwnTube.tv/android/ && ./gradlew assembleRelease
- name: Upload APK Artifact
uses: actions/upload-artifact@v4
with:
name: release apk
path: "./OwnTube.tv/android/app/build/outputs/apk/release/app-release.apk"