-
-
Notifications
You must be signed in to change notification settings - Fork 45
61 lines (55 loc) · 2.11 KB
/
gh-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
# Drafts a GitHub release with the APK attached.
name: Draft GitHub release
on:
workflow_dispatch:
push:
tags:
- v*.*.*
jobs:
android:
name: Draft release and attach APK
runs-on: ubuntu-latest
environment: release-android
env:
UPLOAD_KEYSTORE: ${{ secrets.UPLOAD_KEYSTORE }}
STORE_PASSWORD: ${{ secrets.STORE_PASSWORD }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
KEY_FILE_PATH: android/key.properties
CLIENT_ID: ${{ secrets.CLIENT_ID }}
SECRET: ${{ secrets.SECRET }}
steps:
- name: Checkout Frosty repo
uses: actions/checkout@v4
# Setup Java so that we can build the APK.
- name: Set up Java
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 21
# Setup and cache Flutter to install packages and build.
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
cache: true
# Decode and create the upload-keystore.jks file, used for signing the app.
- name: Decode and create upload-keystore.jks
run: echo $UPLOAD_KEYSTORE | base64 --decode > $GITHUB_WORKSPACE/android/upload-keystore.jks
# Create the key.properties file, used for signing the app.
- name: Create key.properties
run: |
echo storePassword=$STORE_PASSWORD >> $KEY_FILE_PATH
echo keyPassword=$KEY_PASSWORD >> $KEY_FILE_PATH
echo keyAlias=upload >> $KEY_FILE_PATH
echo storeFile=$GITHUB_WORKSPACE/android/upload-keystore.jks >> $KEY_FILE_PATH
# Build the APK with the environment variables and move/rename it.
- name: Build for Android
run: |
flutter build apk --dart-define CLIENT_ID=$CLIENT_ID --dart-define SECRET=$SECRET
mv build/app/outputs/flutter-apk/app-release.apk frosty-${{ github.ref_name }}.apk
# Create a draft release on GitHub.
- name: Release
uses: softprops/action-gh-release@v1
with:
draft: true
generate_release_notes: true
files: frosty-${{ github.ref_name }}.apk