-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (66 loc) · 2.13 KB
/
build-apk.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
name: build apk
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
push:
branches:
- main
- master
tags-ignore:
- v**
workflow_dispatch:
jobs:
build:
name: Release build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# - name: Use Node.js
# uses: actions/setup-node@v3
# - name: Install dependencies
# run: npm install -g gitmoji-changelog
- name: Setup JDK
uses: actions/setup-java@v1
with:
java-version: '11.x'
- name: Setup flutter
uses: subosito/flutter-action@v1
with:
channel: stable
flutter-version: '3.0.5'
- name: Build split apk
run: |
\cp -f pubspec.yaml assets/
ls assets
flutter clean
flutter pub get
flutter build apk --release --no-tree-shake-icons
flutter build apk --target-platform android-arm,android-arm64,android-x64 --split-per-abi --release --no-tree-shake-icons
ls build/app/outputs/flutter-apk
mkdir -p releases
mv -f build/app/outputs/flutter-apk/*-release.apk releases
ls releases
mv -f releases/app-release.apk releases/app-universal-release.apk
ls releases
# - name: Sign build apk
# uses: iota9star/[email protected]
# with:
# releaseDirectory: releases
# fileRegex: .*-release.apk
# signingKeyBase64: ${{ secrets.SIGNING_KEY }}
# alias: ${{ secrets.ALIAS }}
# keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
# keyPassword: ${{ secrets.KEY_PASSWORD }}
# env:
# BUILD_TOOLS_VERSION: "30.0.2"
- name: Rename signed apk
run: |
ls releases
for name in $(ls releases/*-signed.apk);do mv -f $name ${name%-signed.apk}.apk ;done
ls releases
- name: Release to github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
dart scripts/github.dart --token=${{ secrets.GITHUB_TOKEN }} --fun=release --artifacts=releases/*-release.apk