-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (54 loc) · 2 KB
/
release.yml
File metadata and controls
65 lines (54 loc) · 2 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
name: Build and Release
on:
push:
branches:
- master
permissions:
contents: write
jobs:
build-and-release:
runs-on: ubuntu-latest
environment: deployment
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.41.9'
- name: Get version from pubspec
id: version
run: |
VERSION=$(grep -m1 'version:' pubspec.yaml | sed 's/version: //' | sed 's/+.*//')
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
- name: Get short commit SHA
id: sha
run: echo "SHA=${GITHUB_SHA:0:7}" >> $GITHUB_OUTPUT
- name: Get full commit message
id: commit
run: echo "MESSAGE=$(git log -1 --format='%s')" >> $GITHUB_OUTPUT
- name: Configure signing
run: |
echo "storePassword=${{ secrets.STORE_PASSWORD }}" > android/key.properties
echo "keyPassword=${{ secrets.KEY_PASSWORD }}" >> android/key.properties
echo "keyAlias=upload" >> android/key.properties
echo "storeFile=../../keystore/release-key.jks" >> android/key.properties
echo "=== Keystore Debug ==="
cat android/key.properties
echo "======================="
- name: Get dependencies
run: flutter pub get
- name: Build APK
run: flutter build apk --split-per-abi --release
- name: Create Release
uses: softprops/action-gh-release@v1
with:
tag_name: v${{ steps.version.outputs.VERSION }}-${{ steps.sha.outputs.SHA }}
name: Release ${{ steps.version.outputs.VERSION }}
body: |
**Commit:** ${{ steps.sha.outputs.SHA }}
**Message:** ${{ steps.commit.outputs.MESSAGE }}
draft: false
prerelease: false
files: |
build/app/outputs/flutter-apk/app-armeabi-v7a-release.apk
build/app/outputs/flutter-apk/app-arm64-v8a-release.apk
build/app/outputs/flutter-apk/app-x86_64-release.apk