-
Notifications
You must be signed in to change notification settings - Fork 0
135 lines (126 loc) · 4.35 KB
/
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
name: build
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
push:
# branches: [ "main","dev" ]
tags:
- '*'
# Allows you to run this workflow manually from the Actions tab
# workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
flutter-test:
# 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:
- name: Checkout Repository
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
uses: actions/checkout@v3.3.0
- uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '11'
cache: 'gradle'
- name: Update API_KEY from Secrets
run: echo API_KEY=${{ secrets.RSS_API_KEY }} > ./local.properties
- uses: subosito/flutter-action@v2.8.0
with:
channel: 'stable'
architecture: x64
cache: true
- run: flutter pub get
- run: flutter test
android-build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
name: "Build Flutter Android"
needs: [flutter-test]
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Checkout Repository
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
uses: actions/checkout@v3.3.0
- uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '11'
cache: 'gradle'
- name: Download Android keystore
id: android_keystore
uses: timheuer/base64-to-file@v1.0.3
with:
fileName: upload-keystore.jks
encodedString: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}
- name: Create key.properties
run: |
echo "storeFile=${{ steps.android_keystore.outputs.filePath }}" > android/key.properties
echo "storePassword=${{ secrets.STORE_PASSWORD }}" >> android/key.properties
echo "keyPassword=${{ secrets.KEY_PASSWORD }}" >> android/key.properties
echo "keyAlias=${{ secrets.KEY_ALIAS }}" >> android/key.properties
- uses: subosito/flutter-action@v2.8.0
with:
channel: 'stable'
cache: true
- run: flutter pub get
- run: flutter clean
- run: flutter build apk --release
# - run: flutter build appbundle
- run: |
ls build/app/outputs/flutter-apk/ -al
shell: bash
- uses: actions/upload-artifact@v3.1.2
with:
name: app-release
path: build/app/outputs/flutter-apk/
# ios-build:
# name: "Build Flutter (iOS)"
# needs: [flutter-test]
# runs-on: macos-latest
# steps:
# - uses: actions/checkout@v3
# - uses: subosito/flutter-action@v2
# with:
# channel: 'stable'
# architecture: x64
# - run: flutter pub get
# - run: flutter clean
# - run: flutter build ios --release --no-codesign
# - uses: actions/upload-artifact@master
# with:
# name: RSD
# path: build/app/outputs/bundle/release/*.aab
release-assets:
runs-on: ubuntu-latest
needs: [android-build]
steps:
- name: "Download Artificat"
uses: actions/download-artifact@v2.1.1
with:
name: app-release
# path: build/app/outputs/flutter-apk/*.apk
- name: Check Artifact download
run: ls -R
- name: Create Release
id: create_release
uses: ncipollo/release-action@v1.12.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# tag_name: ${{ github.ref }}
artifact: app-release.apk
release_name: Release RSS Alpha
generateReleaseNotes: true
draft: false
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: app-release.apk
asset_name: RSS-Client.apk
asset_content_type: application/vnd.android.package-archive