-
-
Notifications
You must be signed in to change notification settings - Fork 23
94 lines (80 loc) · 3.39 KB
/
Copy pathrelease.yml
File metadata and controls
94 lines (80 loc) · 3.39 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
name: Release APK
on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
tag_name:
description: 'Tag name for the release (e.g. v1.0.0)'
required: true
default: 'v-dev'
permissions:
contents: write
jobs:
build-and-release:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '21'
- name: Install SQLite
run: |
sudo apt-get update
sudo apt-get install -y sqlite3 libsqlite3-dev
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.24.5'
- name: Install Dependencies
run: flutter pub get
- name: Generate Mocks
run: flutter pub run build_runner build --delete-conflicting-outputs
- name: Generate Database Migrations Schema
run: flutter pub run drift_dev schema generate drift_schemas/ test/generated_migrations/
- name: Configure Keystore Signing
env:
KEYSTORE_BASE64: ${{ secrets.KEYSTORE_BASE64 }}
if: ${{ env.KEYSTORE_BASE64 != '' }}
run: |
python3 -c "import os, base64; s = os.environ['KEYSTORE_BASE64']; s = ''.join(s.split()); m = len(s) % 4; s += '=' * (4 - m) if m else ''; open('android/my-release-key.jks', 'wb').write(base64.b64decode(s))"
- name: Build Release APKs
env:
KEYSTORE_FILE: "../my-release-key.jks"
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
run: |
# Build universal APK first
flutter build apk --release --target-platform=android-arm,android-arm64
# Rename/save it temporarily
mv build/app/outputs/flutter-apk/app-release.apk build/app/outputs/flutter-apk/app-release.apk.temp
# Build split APKs
flutter build apk --release --split-per-abi --target-platform=android-arm,android-arm64
# Rename to final LTvLauncher-* names
mv build/app/outputs/flutter-apk/app-release.apk.temp build/app/outputs/flutter-apk/LTvLauncher-universal-release.apk
mv build/app/outputs/flutter-apk/app-armeabi-v7a-release.apk build/app/outputs/flutter-apk/LTvLauncher-armeabi-v7a-release.apk
mv build/app/outputs/flutter-apk/app-arm64-v8a-release.apk build/app/outputs/flutter-apk/LTvLauncher-arm64-v8a-release.apk
- name: Generate Release Notes
env:
TAG_NAME: ${{ github.event.inputs.tag_name || github.ref_name }}
run: python3 .github/scripts/generate_release_notes.py
- name: Create GitHub Release and Upload APKs
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.event.inputs.tag_name || github.ref_name }}
body_path: release_notes.md
files: |
build/app/outputs/flutter-apk/LTvLauncher-universal-release.apk
build/app/outputs/flutter-apk/LTvLauncher-armeabi-v7a-release.apk
build/app/outputs/flutter-apk/LTvLauncher-arm64-v8a-release.apk
draft: false
prerelease: ${{ contains(github.event.inputs.tag_name || github.ref_name, '-') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}