-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (39 loc) · 1.29 KB
/
deploy_android.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
name: deploy_android
on:
workflow_dispatch:
permissions:
contents: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install and set Flutter version
uses: subosito/flutter-action@v2
with:
flutter-version: '3.x'
channel: 'stable'
- name: Flutter Doctor
run: flutter doctor
- name: Install Melos
run: dart pub global activate melos
- name: Melos Bootstrap
run: dart run melos bootstrap
- name: Set version
run: dart run melos set_version
- name: Build Android
run: cd apps/app_main && flutter build apk --release
- name: Extract version from pubspec.yaml
id: extract_version
run: |
version=$(grep '^version:' apps/app_main/pubspec.yaml | sed 's/version: //')
echo "version=$version" >> $GITHUB_ENV
- name: Install GitHub CLI
run: sudo apt-get install gh -y
- name: Create GitHub Release and Upload APK
run: |
gh release create v${{ env.version }} apps/app_main/build/app/outputs/flutter-apk/app-release.apk --title "Release v${{ env.version }}"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash