-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (46 loc) · 1.42 KB
/
build-android.yml
File metadata and controls
57 lines (46 loc) · 1.42 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
name: Build Android APK
on:
workflow_dispatch:
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
jobs:
build-android-apk:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Setup Java (17)
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 17
- name: Setup Flutter (stable)
uses: subosito/flutter-action@v2
with:
channel: stable
cache: true
- name: Flutter pub get
run: flutter pub get
- name: Build APK (release)
run: flutter build apk --release
- name: Read version from pubspec.yaml
id: ver
shell: bash
run: |
VERSION=$(grep '^version:' pubspec.yaml | awk '{print $2}' | cut -d'+' -f1)
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
- name: Rename APK to LocalDrop-android-vX.Y.Z.apk
id: apk
shell: bash
run: |
set -e
SRC_APK=$(ls -1 build/app/outputs/flutter-apk/*.apk | head -n 1)
VERSION="${{ steps.ver.outputs.version }}"
DEST_APK="LocalDrop-android-v${VERSION}.apk"
cp "$SRC_APK" "$DEST_APK"
echo "apk_path=$DEST_APK" >> "$GITHUB_OUTPUT"
- name: Upload Android artifact
uses: actions/upload-artifact@v6
with:
name: LocalDrop-android
path: ${{ steps.apk.outputs.apk_path }}