-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (37 loc) · 1.38 KB
/
Copy pathandroid_release.yml
File metadata and controls
47 lines (37 loc) · 1.38 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
name: Android Release
on:
workflow_dispatch:
jobs:
build:
name: flutter release apk
runs-on: ubuntu-latest
env:
APP_NAME: ${{ vars.APP_NAME }}
BUILD_PATH: build/app/outputs/flutter-apk/
steps:
- uses: actions/checkout@v3
- id: read-version
uses: NiklasLehnfeld/flutter-version-number-action@main
with:
file-path: pubspec.yaml
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
flutter-version: ${{ vars.FLUTTER_VERSION }}
- name: Clean project dependencies
run: flutter clean
- name: Install project dependencies
run: flutter pub get
- name: Generate intermediates
run: flutter pub run build_runner build --delete-conflicting-outputs
- name: Build artifacts
run: flutter build apk --release --flavor production
- name: Rename file
run: mv ${{ env.BUILD_PATH }}app-production-release.apk ${{ env.BUILD_PATH }}${{ env.APP_NAME }}-${{ steps.read-version.outputs.version-number }}.apk
- name: Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.APP_NAME }}-${{ steps.read-version.outputs.version-number }}
files: ${{ env.BUILD_PATH }}${{ env.APP_NAME }}-${{ steps.read-version.outputs.version-number }}.apk
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}