-
-
Notifications
You must be signed in to change notification settings - Fork 5
84 lines (70 loc) · 2.76 KB
/
build_and_github_release.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
name: Build and Github Release
run-name: Cooking the next version
on:
push:
tags:
- 'v*'
jobs:
build:
name: Build APK
runs-on: ubuntu-latest
steps:
- name: Enable KVM group perms
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
ls /dev/kvm
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Set up JDK 21
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
with:
java-version: '21'
distribution: 'temurin'
- name: Setup Android SDK
uses: android-actions/setup-android@00854ea68c109d98c75d956347303bf7c45b0277 # v3.2.1
- name: Download Android NDK
run: sdkmanager --install "ndk;25.2.9519653"
- name: Download CMake
run: sdkmanager --install "cmake;3.22.1"
- name: Download and extract OpenCV SDK
run: |
wget https://github.com/opencv/opencv/releases/download/4.10.0/opencv-4.10.0-android-sdk.zip -O .\opencv-sdk.zip
unzip .\opencv-sdk.zip
- name: Config OpenCV SDK
run: echo "sdk.dir=$GITHUB_WORKSPACE/OpenCV-android-sdk" > "opencv.properties"
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Decode and persist temporarily Keystore
run: |
DEST_FILE_PATH="${RUNNER_TEMP}"/release-key.jks
echo "KEYSTORE_FILE_PATH=$DEST_FILE_PATH" >> "$GITHUB_ENV"
base64 -d <<< "${{ secrets.RELEASE_STORE_FILE_BASE64 }}" > $DEST_FILE_PATH
- name: Assemble release variant
run: ./gradlew :app:assembleRelease
env:
RELEASE_STORE_FILE_PATH: ${{ env.KEYSTORE_FILE_PATH }}
RELEASE_KEY_ALIAS: ${{ secrets.RELEASE_KEY_ALIAS }}
RELEASE_KEY_PASS: ${{ secrets.RELEASE_KEY_PASS }}
RELEASE_STORE_PASS: ${{ secrets.RELEASE_STORE_PASS }}
- name: Upload APK
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
with:
name: app-release
path: app/build/outputs/apk/release/app-release.apk
release:
name: Release
needs: build
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Download APK from build
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: app-release
- name: Create release
uses: softprops/action-gh-release@9d7c94cfd0a1f3ed45544c887983e9fa900f0564 # v2.0.4
with:
files: app-release.apk