-
Notifications
You must be signed in to change notification settings - Fork 4
70 lines (66 loc) · 2.16 KB
/
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
name: Create GitHub Release
on:
push:
tags:
- '*'
workflow_dispatch:
jobs:
build:
name: Build Android App
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17.x'
cache: gradle
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.22.1'
channel: 'stable'
cache: true
- name: Get dependencies
run: flutter pub get
- name: Download Android keystore
id: android_keystore
uses: timheuer/[email protected]
with:
fileName: sn-upload-keystore.jks
encodedString: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}
- name: Create key.properties
run: |
echo "storeFile=${{ steps.android_keystore.outputs.filePath }}" > android/key.properties
echo "storePassword=${{ secrets.STORE_PASSWORD }}" >> android/key.properties
echo "keyPassword=${{ secrets.KEY_PASSWORD }}" >> android/key.properties
echo "keyAlias=${{ secrets.KEY_ALIAS }}" >> android/key.properties
- name: Build APK (split per ABI)
run: flutter build apk --split-per-abi --flavor prod
- name: Archive build artifacts
uses: actions/upload-artifact@v2
with:
name: android-release
path: |
build/app/outputs/flutter-apk/app-arm64-v8a-prod-release.apk
build/app/outputs/flutter-apk/app-armeabi-v7a-prod-release.apk
build/app/outputs/flutter-apk/app-x86_64-prod-release.apk
release:
name: Create GitHub Release
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download build artifacts
uses: actions/download-artifact@v2
with:
name: android-release
- name: Release
uses: softprops/action-gh-release@v2
with:
files: |
app-arm64-v8a-prod-release.apk
app-armeabi-v7a-prod-release.apk
app-x86_64-prod-release.apk
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}