This repository was archived by the owner on Feb 4, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 28
184 lines (152 loc) Β· 5.27 KB
/
release.yml
File metadata and controls
184 lines (152 loc) Β· 5.27 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
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
name: release
on:
push:
tags:
- "v*.*.*"
jobs:
get-vars:
name: Get vars
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.vars.outputs.tag }}
steps:
- uses: actions/checkout@v2
- name: Set variables
id: vars
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
android-build:
name: Android build
runs-on: ubuntu-latest
needs: get-vars
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: "12.x"
- uses: subosito/flutter-action@v1
with:
channel: "stable"
- name: Get dependencies
run: flutter pub get
- name: Inject keystore
working-directory: android/app
run: |
echo "${{ secrets.SIGNING_KEY }}" | base64 -d | tee key.jks >/dev/null
- name: Generate appbundle
env:
ANDROID_KEY_ALIAS: ${{ secrets.ALIAS }}
ANDROID_KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
ANDROID_STORE_PATH: key.jks
ANDROID_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }}
run: flutter build appbundle --release --target lib/main_prod.dart --flavor prod
- uses: actions/upload-artifact@v2
with:
name: android-appbundle
path: |
build/app/outputs/bundle/prodRelease/app-prod-release.aab
- name: Android build
env:
ANDROID_KEY_ALIAS: ${{ secrets.ALIAS }}
ANDROID_KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
ANDROID_STORE_PATH: key.jks
ANDROID_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }}
run: |
flutter build apk --split-per-abi --release --target lib/main_prod.dart --flavor prod
mv build/app/outputs/flutter-apk/app-arm64-v8a-prod-release.apk lemmur-${{ needs.get-vars.outputs.tag }}-arm64-v8a-android.apk
mv build/app/outputs/flutter-apk/app-armeabi-v7a-prod-release.apk lemmur-${{ needs.get-vars.outputs.tag }}-armeabi-v7a-android.apk
mv build/app/outputs/flutter-apk/app-x86_64-prod-release.apk lemmur-${{ needs.get-vars.outputs.tag }}-x86_64-android.apk
- uses: actions/upload-artifact@v2
with:
name: android-build
path: |
lemmur-*.apk
linux-build:
name: Linux build
needs: get-vars
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v1
with:
channel: "stable"
- name: Get additional dependencies
run: |
sudo apt-get update -y
sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev libblkid-dev
- name: Build
run: |
flutter build linux --release --target lib/main_prod.dart
- name: Archive
working-directory: build/linux/x64/release/bundle
run: |
tar -czf lemmur-${{ needs.get-vars.outputs.tag }}-x86_64-linux.tar.gz *
- uses: actions/upload-artifact@v2
with:
name: linux-build
path: build/linux/x64/release/bundle/lemmur-*.tar.gz
windows-build:
name: Windows build
needs: get-vars
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v1
with:
channel: "stable"
- name: Build
run: |
flutter build windows --release --target lib/main_prod.dart
- name: Archive
working-directory: build/windows/runner/Release
run: |
7z a lemmur-${{ needs.get-vars.outputs.tag }}-x86_64-windows.zip *
- uses: actions/upload-artifact@v2
with:
name: windows-build
path: build/windows/runner/Release/lemmur-*.zip
release:
name: Release
needs:
- get-vars
- android-build
- linux-build
- windows-build
runs-on: ubuntu-latest
if: github.repository == 'LemmurOrg/lemmur'
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v2
- name: ls
run: ls -R
- name: Extract current changelog
run: mv fastlane/metadata/android/en-US/changelogs/$(ls fastlane/metadata/android/en-US/changelogs/ | xargs -I'{}' basename '{}' .txt | sort -n | tail -n 1).txt current-changelog.txt
- name: Release to GitHub
uses: softprops/action-gh-release@v1
with:
files: |
android-build/*
linux-build/*
windows-build/*
draft: true
body_path: current-changelog.txt
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Ruby
uses: actions/setup-ruby@v1
with:
ruby-version: "2.7"
- name: Download bundle dependencies
working-directory: fastlane
run: |
gem install bundler:2.0.2
bundle config path vendor/bundle
bundle install
- name: Release to Google Play (beta)
working-directory: fastlane
run: |
echo $GOOGLE_SERVICE_ACCOUNT_KEY > ../$GOOGLE_SERVICE_ACCOUNT_KEY_PATH
bundle exec fastlane android prod
env:
GOOGLE_SERVICE_ACCOUNT_KEY_PATH: google-service-account-key.json
GOOGLE_SERVICE_ACCOUNT_KEY: ${{ secrets.GOOGLE_SERVICE_ACCOUNT_KEY }}
ABB_PATH: android-appbundle/app-prod-release.aab