-
-
Notifications
You must be signed in to change notification settings - Fork 199
79 lines (68 loc) · 2.49 KB
/
fdroid.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
71
72
73
74
75
76
77
78
79
name: Test, Build and Release Fdroid apk
on:
workflow_dispatch:
push:
branches:
- master
env:
PROPERTIES_PATH: './android/key.properties'
jobs:
build:
name: Build APK
runs-on: ubuntu-latest
if: "contains(github.event.head_commit.message, 'Update:')"
steps:
- uses: actions/checkout@v4
# Extract version from commit message
- name: Extract version
id: extract_version
run: |
version=$(echo ${{ github.event.head_commit.message }} | grep -oP '(?<=Update: v)\d+\.\d+\.\d+')
echo "version=${version}" >> $GITHUB_OUTPUT
# Setup Java environment in order to build the Android app.
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17.x'
# Gradle cache for faster builds
- uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
# Setup the flutter environment.
- run: |
pip install -U yq
echo "FLUTTER_VERSION=$(yq -r .environment.flutter pubspec.yaml | sed 's/\^//g')" >> $GITHUB_ENV
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
flutter-version: "${{ env.FLUTTER_VERSION }}"
#
- run: |
echo keyPassword=\${{ secrets.KEY_STORE }} > ${{env.PROPERTIES_PATH}}
echo storePassword=\${{ secrets.KEY_PASSWORD }} >> ${{env.PROPERTIES_PATH}}
echo keyAlias=\${{ secrets.KEY_ALIAS }} >> ${{env.PROPERTIES_PATH}}
#
- run: echo "${{ secrets.KEYSTORE2 }}" | base64 --decode > android/app/key.jks
# Get flutter dependencies.
- run: flutter pub get
# Check for any formatting issues in the code.
- run: dart format --set-exit-if-changed .
# Statically analyze the Dart code for any errors.
- run: flutter analyze .
# Build universal apk.
- run: flutter build apk --release --flavor fdroid -t lib/main_fdroid.dart
# Release universal Fdroid apk.
- uses: svenstaro/upload-release-action@v2
with:
repo_name: gokadzev/Musify
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: build/app/outputs/flutter-apk/app-fdroid-release.apk
asset_name: Musify-fdroid.apk
tag: ${{ steps.extract_version.outputs.version }}
prerelease: false
overwrite: true