-
Notifications
You must be signed in to change notification settings - Fork 4
99 lines (82 loc) · 2.62 KB
/
flutter-build.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: Flutter CI
# This workflow is triggered on pushes to the repository.
on:
push:
branches:
- main
# on: push # Default will running for every branch.
jobs:
build:
# This job will run on ubuntu virtual machine
permissions: write-all
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-deap: 0
- name: Get next version
uses: reecetech/[email protected]
id: version
with:
release_branch: main
scheme: semver
increment: patch
- run: echo ${{ steps.version.outputs.version }}
- name: Set up JDK 17.0
uses: actions/setup-java@v1
with:
java-version: 17.0
- name: Setup Android SDK
uses: android-actions/setup-android@v2
- name: Setup Flutter SDK
uses: flutter-actions/setup-flutter@v2
with:
channel: stable
version: 3.19.5
- name: Install dependencies
run: flutter pub get
- name: Analyze project source
run: dart analyze
- name: Decode Keystore
id: decode_keystore
uses: timheuer/base64-to-file@v1
with:
fileName: 'keystore.jks'
encodedString: ${{ secrets.KEYSTORE }}
# - name: Run tests
# run: flutter test
# Build apk.
- name: build apk
run: flutter build apk
# Upload generated apk to the artifacts.
- name: relase output
uses: actions/upload-artifact@v1
with:
name: release-apk
path: build/app/outputs/apk/release/app-release.apk
- name: create-release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITUB_TOKEN }}
with:
tag_name: v${{ steps.version.outputs.version }}
release_name: Release ${{ steps.version.outputs.version }}
draft: true
prerelease: false
- name: Upload release asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: build/app/outputs/apk/release/app-release.apk
asset_name: reciper-release-${{ steps.version.outputs.version }}.apk
asset_content_type: application/apk
- name: Publish release
uses: eregon/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITUB_TOKEN }}
with:
release_id: ${{ steps.create_release.outputs.id }}