-
Notifications
You must be signed in to change notification settings - Fork 1
69 lines (57 loc) · 2.11 KB
/
android_release.yml
File metadata and controls
69 lines (57 loc) · 2.11 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
name: Build Android Release APK
on:
workflow_dispatch:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
jobs:
build:
name: Build APK
runs-on: ubuntu-latest
# Only run if triggered by a version tag, not manual dispatch from master
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'oracle'
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
flutter-version: '3.32.x'
- name: Install Flutter dependencies
run: flutter pub get
- name: Decode keystore file
env:
KEYSTORE_BASE64: ${{ secrets.KEYSTORE_BASE64 }}
run: |
echo "$KEYSTORE_BASE64" | base64 --decode > android/key.jks
- name: Create key.properties
run: |
echo "storeFile=../key.jks" > android/key.properties
echo "storePassword=${{ secrets.KEYSTORE_PASSWORD }}" >> android/key.properties
echo "keyAlias=${{ secrets.KEY_ALIAS }}" >> android/key.properties
echo "keyPassword=${{ secrets.KEYSTORE_PASSWORD }}" >> android/key.properties
cat android/key.properties
- name: Fetch Git Commit Hash
id: get_commit
run: |
echo "::set-output name=commit_hash::$(git rev-parse --short HEAD)"
echo "::set-output name=build_date::$(date '+%Y-%b-%d')"
- name: Build APK
run: |
cp .env.production .env
COMMIT_HASH=${{ steps.get_commit.outputs.commit_hash }}
BUILD_DATE=${{ steps.get_commit.outputs.build_date }}
VERSION_INFO="$COMMIT_HASH ($BUILD_DATE)"
sed -i "s/VERSION_PLACEHOLDER/$VERSION_INFO/" .env
sed -i "s/SEQ_API_KEY_PLACEHOLDER/${{ secrets.SEQ_API_KEY }}/" .env
flutter build apk --release
- name: Make Github release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
token: ${{ secrets.RELEASE_TOKEN }}
files: |
build/app/outputs/flutter-apk/app-release.apk