-
Notifications
You must be signed in to change notification settings - Fork 173
81 lines (72 loc) · 2.76 KB
/
prbuild.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
# This is a basic workflow to help you get started with Actions
name: Dev Build CI
on:
pull_request:
branches: ["main", "dev"]
push:
branches: ["dev"]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build-and-release-android:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- name: Flutter action
uses: subosito/flutter-action@v2
with:
flutter-version: 3.16.1
channel: stable
- name: Decode keystore
run: |
echo $ENCODED_KEYSTORE | base64 -di > android/app/keystore.jks
env:
ENCODED_KEYSTORE: ${{ secrets.KEYSTORE }}
- run: flutter pub get
# 打包apk
- name: Collect Apks
run: flutter build apk --release --split-per-abi
env:
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD}}
# 发布安装包
- name: Upload Artifact - armeabi-v7a
uses: actions/upload-artifact@v3
with:
path: "build/app/outputs/flutter-apk/app-armeabi-v7a-release.apk"
name: Miru-pr-${{ github.event.pull_request.number }}-armeabi-v7a.apk
- name: Upload Artifact - arm64-v8a
uses: actions/upload-artifact@v3
with:
path: "build/app/outputs/flutter-apk/app-arm64-v8a-release.apk"
name: Miru-pr-${{ github.event.pull_request.number }}-arm64-v8a.apk
- name: Upload Artifact - x86
uses: actions/upload-artifact@v3
with:
path: "build/app/outputs/flutter-apk/app-x86_64-release.apk"
name: Miru-pr-${{ github.event.pull_request.number }}-x86_64.apk
build-and-release-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
flutter-version: 3.16.1
channel: stable
- name: Install project dependencies
run: flutter pub get
- name: Build artifacts
run: flutter build windows --release
- name: Rename Release Directory Name to Miru-App # 为了解压缩后更好看一点
run: |
mv build/windows/x64/runner/Release build/windows/x64/runner/Miru-App
# 发布安装包
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
path: "build/windows/x64/runner/Miru-App"
name: Miru-pr-${{ github.event.pull_request.number }}-windows.zip